adrian Posted November 15, 2021 Author Share Posted November 15, 2021 Try 1 or 2 GB, but do it in AdminActions.module so it's not affecting your site in general. In reality I think that the backup method from the PW core (that AA uses) needs to be converted to use system tools like mysqldump so it is performant and won't hit these memory limits. I believe I have mentioned this to Ryan somewhere. ProcessDuplicator has the option for this, but I'd rather see it implemented in the PW core. Link to comment Share on other sites More sharing options...
stanoliver Posted December 8, 2021 Share Posted December 8, 2021 Hi @adrian, sometimes I have just stored some .csv-data in a normal processwire textarea field per copy-paste Nothing more than for example: id;name;age; 1;Joe;34 2;Jane;32 So far so good. Now I would like to do same thing (copy-paste these 3 lines of code into a textarea field) but this time these 3 lines should be "magicly" transformed into json and saved as json. Could you may implement it as an admin action? If not could may just tell me how I could transform it to json via php or javascript but as an simple standalone script. It's not possible for me to use an online csv-to-json converter. Hopefully my English was good enough Stan Oliver Link to comment Share on other sites More sharing options...
adrian Posted December 8, 2021 Author Share Posted December 8, 2021 I am sure an action could be built for this, but you might instead want to take a look at this fieldtype - I have used it in the past and it works really well. Link to comment Share on other sites More sharing options...
stanoliver Posted December 15, 2021 Share Posted December 15, 2021 @adrian thanks for your advice! I also read about FieldtypeJson but I was irritated by the warnings "Alpha state", " To be fair, i've already set this module to be deleted 2 times, but somehow it won't delete. Better to go for other options like Kongondo's matrix field or use the Profields. There's big change that there will be Data loss when using this module as it relies heavily upon Javascript." and "Please us Matrix Fieldtype & Inputfield" from @kongondo. Do you guys @adrianand @kongondo think the following statement is right? Inputfield json is for beginners and easy tasks (like I described above) faster/easyier and more comfortable to use than Matrix Fieldtype which is to be fair probably way more powerful? Link to comment Share on other sites More sharing options...
adrian Posted December 15, 2021 Author Share Posted December 15, 2021 @stanoliver - I'll let @kongondo discuss his Matrix fieldtype more - I do use it and like most things, it has its pros and cons. It looks to me like the Profields Table field module might be best suited to your needs. 1 Link to comment Share on other sites More sharing options...
stanoliver Posted December 24, 2021 Share Posted December 24, 2021 On 12/8/2021 at 3:48 PM, adrian said: I have used it in the past and it works really well. Hi @adrian after reading the docs/the modules forum of Fieldtype Json I was pretty sure that module would be enough and installed without problems. If I am informed right then @Martijn Geerts stepped back from developing his module. I may ask you for help because you mentioned the module is working for you. Problem: Installation of Fieltype Json works fine and the settings page for the module I also found. Most setting options clicked seem to save just fine but if I copy-paste some csv-text-content into the textareafield (csv-field) under settings nothing happens (I can not even see that text was inserted) when I click on save. Can you may help me? Alternative: which would help me too (in case you know a simple solution or some good links? I have a standard fieldtype file in my template and uploaded a csv-file. How can I make the content data of the csv-file visible in a different textareafield? In the next step I would like that if I change content in the visible textareafield and save it everything gets synchronised with the original uploaded csv-file in the file field. Idea: 2-way-synchronisation (maybe one way-sync could work too) between an pw file field/a single csv-file and a pw textarea field HAPPY CHRISTMAS! Link to comment Share on other sites More sharing options...
Fuzen Posted May 8, 2022 Share Posted May 8, 2022 I’ve got a request. I love this module and use it a few times a week. The problem I just encountered is that fields that are Floats cannot be selected and updated via the “Field Set or Search and Replace” option. I’d love to see Floats added. 1 Link to comment Share on other sites More sharing options...
adrian Posted May 8, 2022 Author Share Posted May 8, 2022 Hi @fuzenco - can you please do me a favor and try changing this line: https://github.com/adrianbj/ProcessAdminActions/blob/331e210404b7f883aec04c4342185c04be24d57d/actions/FieldSetOrSearchAndReplace.action.php#L23 to: if (!$field->type instanceof FieldtypeText && !$field->type instanceof FieldtypeFloat) continue; That should work, but please test and let me know and then I'll update the action. 1 1 Link to comment Share on other sites More sharing options...
Fuzen Posted May 8, 2022 Share Posted May 8, 2022 12 hours ago, adrian said: Hi @fuzenco - can you please do me a favor and try changing this line: https://github.com/adrianbj/ProcessAdminActions/blob/331e210404b7f883aec04c4342185c04be24d57d/actions/FieldSetOrSearchAndReplace.action.php#L23 to: if (!$field->type instanceof FieldtypeText && !$field->type instanceof FieldtypeFloat) continue; That should work, but please test and let me know and then I'll update the action. @adrian Amazing. That worked perfectly. The fields were selectable and I was able to update my entries as a result. Thanks much! 1 Link to comment Share on other sites More sharing options...
adrian Posted May 9, 2022 Author Share Posted May 9, 2022 @fuzenco - new version just committed that also supports integer & decimal field types as well as float. 3 1 Link to comment Share on other sites More sharing options...
Fuzen Posted May 13, 2022 Share Posted May 13, 2022 On 5/9/2022 at 1:25 PM, adrian said: @fuzenco - new version just committed that also supports integer & decimal field types as well as float. Thank you @adrian 1 Link to comment Share on other sites More sharing options...
froot Posted September 2, 2022 Share Posted September 2, 2022 I'm getting Sorry, you do not have permission to use this action. when trying to run a custom action. I have role superuser and I gave superusers all available permissions though… What could that be? Link to comment Share on other sites More sharing options...
adrian Posted September 2, 2022 Author Share Posted September 2, 2022 Hi @fruid - you need to assign roles to the action within the module settings interface. Link to comment Share on other sites More sharing options...
froot Posted September 2, 2022 Share Posted September 2, 2022 20 minutes ago, adrian said: Hi @fruid - you need to assign roles to the action within the module settings interface. I did that already, that's why I reach out. Actually, none of my actions work. They used to though. Link to comment Share on other sites More sharing options...
froot Posted September 2, 2022 Share Posted September 2, 2022 what's also weird is that now the actions are executable with no need to populate the options fields where I set 'required' => true. The actions run nonetheless and I get some Allowed memory size of 536870912 bytes exhausted Error. How can that be? It should not execute in that case. I have never changed that module and the page actions ever since it worked properly. Link to comment Share on other sites More sharing options...
froot Posted September 15, 2022 Share Posted September 15, 2022 I'm trying to use the core admin action Field Set or Search and Replace to set a value of a field inside a repeater field. That doesn't work, I tried with the option "Use Regex" ticked and unticked as well as the option "default" Language ticked and unticked. I guess repeater fields are more complex for this action to get the job right. Any suggestions? Link to comment Share on other sites More sharing options...
Robin S Posted January 24, 2023 Share Posted January 24, 2023 Hi @adrian, The "Delete Unused Templates" action is throwing an error for me in recent PW versions: Maybe related to this change mentioned in the 3.0.210 release blog post? Quote Updated the $templates->delete($template) method to also delete fieldgroup having the same name as the template (when that fieldgroup is not used elsewhere). Update: adding an if($fieldgroup) test to the action seems to resolve it... if($fieldgroup) $this->wire('fieldgroups')->delete($fieldgroup); 1 Link to comment Share on other sites More sharing options...
adrian Posted January 24, 2023 Author Share Posted January 24, 2023 Thanks @Robin S for the report and fix. It's in the latest version. 3 Link to comment Share on other sites More sharing options...
Laegnur Posted September 19 Share Posted September 19 Hello I maintain a website where we give access to employers from other companies to place orders. Therefore, every year we delete old users and register new ones. To do this, we have the ProcessAdminActions module installed to manipulate pages in bulk. We add these selectors to the Page manipulator, so we filter the pages to only the users, with role employee. It says it will touch 10518 pages, that is the number of users we want to delete. The past year we upgrade the Processwire to latest version after doing this process, and now, it tries to delete home page (/). Any idea why this don't work anymore? Any other way to workaround to delete the 10k users? Link to comment Share on other sites More sharing options...
adrian Posted September 19 Author Share Posted September 19 Hi @Laegnur - thanks for the report. I don't honestly know when this stopped working as expected, but I have added array('allowCustom' => true) to the "$pages->find" call that results from the selector you define and it works now in the latest version. Let me know if you have any continuing issues. Link to comment Share on other sites More sharing options...
Laegnur Posted September 20 Share Posted September 20 Hello Many thanks. Now it works correctly. Link to comment Share on other sites More sharing options...
Robin S Posted Sunday at 01:29 AM Share Posted Sunday at 01:29 AM Hi @adrian, Is it possible for an action to return markup apart from the successMessage and failureMessage? I'd like to use MarkupAdminDataTable to show a table of results of the action. Putting the markup in successMessage sort of works, except it has the green background so I figure it's intended for a simple sentence rather than longer markup like this. If the module doesn't already have a solution for this that I've missed, what do you think about adding a new method similar to successMessage(), or maybe if the return value of executeAction() is a string rather than boolean the module could render that under the success/failure message? Thanks for considering. Link to comment Share on other sites More sharing options...
adrian Posted Sunday at 02:05 AM Author Share Posted Sunday at 02:05 AM Hey @Robin S - yep, all you need to do is populate: $this->output = 'this'; $this->output .= 'and that'; return true; inside the executeAction() method. 1 Link to comment Share on other sites More sharing options...
Robin S Posted Sunday at 02:13 AM Share Posted Sunday at 02:13 AM @adrian, wonderful, thanks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now