Closed (fixed)
Project:
Resave All Nodes
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2022 at 14:03 UTC
Updated:
29 Mar 2022 at 11:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ptmkenny commentedI got some help on this Drupal Answers question, so I'm posting my patch for this here.
It's not very good-- it re-saves all nodes (does not support saving only content types), and for that reason
getNodeIds()is duplicated, so it needs a lot of work, but it does add a functional drush command for simply resaving all the nodes.Comment #3
norman.lolMan Patrick thank you for diving into this! I definitely gonna add that together with what I found has been added to Drush core only 5 months ago: https://github.com/drush-ops/drush/blob/11.0.7/src/Drupal/Commands/core/.... Drush now also comes with its own
entity:savecommand to re-save any kind of entity:drush entity:save node --bundle=article --chunks=5.Comment #5
norman.lolI copied a lot of stuff from https://github.com/drush-ops/drush/blob/11.0.7/src/Drupal/Commands/core/... with some small adjustments. And I'm not sure if this requires Drush 11 or if it also works with Drush 9 or 10. Gonna check that later.