Keyword

Batch Editing of Extra Fields

More
2 months 1 day ago #169090 by Ralf
Ralf created the topic: Batch Editing of Extra Fields
I have a client who has many similar Extra Fields set to Required and which now have to be changed to Not-Required.

Is there anyway to do this as mass-edit as in Wordpress?

In case this question has been answered already I didn't find it. Please push me in the right direction. Thx :-)

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 23 hours ago #169093 by Fotis
Fotis replied the topic: Batch Editing of Extra Fields
There is currently no batch editing for extra fields in K2, sorry.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Extensions Developer
More
1 month 4 weeks ago - 1 month 4 weeks ago #169134 by Mohamed Abdelaziz
Mohamed Abdelaziz replied the topic: Batch Editing of Extra Fields
Hi Ralf,
If you can access the database to run SQL statements, this can be done.
Extra field parameters, like the required parameter, are saved as JSON string, so SQL can be used to modify this string and replace "required":1 with "required":0

Make sure to backup the table #__k2_extra_fields at first.
The SQL statement can be something like this, replace '#_' with your database prefix:
UPDATE #__k2_extra_fields 
SET `value` = REPLACE(`value`, '"required":1', '"required":0')
WHERE id IN (Field1, Field1, ..., FieldN )
Please make sure to replace Field1, Field1, ..., FieldN with a comma separated field ids which you want to edit
Last Edit: 1 month 4 weeks ago by Mohamed Abdelaziz.

Please Log in or Create an account to join the conversation.

Moderators: william white