Jump to content

Admin Actions


adrian

Recommended Posts

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

  • 4 weeks later...

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

@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

  • 2 weeks later...
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

  • 4 months later...

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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!

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

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

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

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

  • 2 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...