0

how are you?

Do you know what's the best way to fill a new field inside of Paragraphs in a Production Environment?

E.g.:

  1. I have a Paragraph called "MyParagraph" and this Paragraph has two fields "Title" and "Description";
  2. This Paragraph is already present on our Production Environment and there are 500 nodes with this Paragraph filled;
  3. I created right now a new field called "Show Description". This field is a checkbox and default is "Checked";

Now I need to update all of these 50 Paragraphs in production with this new field "Show Description" = TRUE

Do you know what's the best option to do that?

I used a simple hook_update to do this, and another script with a batch process. But I want to see if there is the best solution to do this update.

5
  • 1
    hook_update_N already comes with batch capabilities. But 50 Paragraphs isn't that much. I doubt that this needs a batch process. When you ask for "best" you'll get opinions, not a right answer. I think hook_update_N is best.
    – leymannx
    Sep 29, 2020 at 22:35
  • 1
    Other option is to use views bulk operations.
    – No Sssweat
    Sep 29, 2020 at 23:50
  • Or just open 50 tabs and update them manually. 😅
    – leymannx
    Sep 30, 2020 at 21:09
  • I used ”50” just as an example. There are more than 500 to update.
    – RenatoG
    Sep 30, 2020 at 23:45
  • @No-Sssweat I didn’t used views build operations before. Using it I can update all paragraphs by CMS that's it? 🤔
    – RenatoG
    Sep 30, 2020 at 23:48

1 Answer 1

0

For a no custom code solution, Use Views Bulk Operations with Views Update Fields

Or with Views Bulk Edit, although it's crashing with Paragraphs, so maybe in the future for this particular case.

PS: Do first a dry run on dev/local before doing it on live.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.