Problem/Motivation

Add a drush command as described on the module's project page.

Remaining tasks

* Write the drush command.
* Write tests.

CommentFileSizeAuthor
#2 3265249-2_resave_all_nodes_drush.patch3.62 KBptmkenny

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Status: Active » Needs work
StatusFileSize
new3.62 KB

I 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.

norman.lol’s picture

Man 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:save command to re-save any kind of entity: drush entity:save node --bundle=article --chunks=5.

  • leymannx committed b569d2b on 8.x-1.x authored by ptmkenny
    Issue #3265249 by ptmkenny, leymannx: Add drush command
    
norman.lol’s picture

Status: Needs work » Fixed

I 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.