drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

[update:execute] Batch updates are not supported

Open longwave opened this issue 8 years ago • 3 comments

Problem/Motivation

In https://www.drupal.org/project/drupal/issues/2997960 it was identified that taxonomy_update_8502() is not run correctly via update:execute when more than 100 terms are present in the database.

hook_update_N allows long running update operations to be batched via the $context parameter, as documented at https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension%21module.api.php/function/hook_update_N/8.6.x but it appears Drupal Console does not implement this, as per https://github.com/hechoendrupal/drupal-console/blob/master/src/Command/Update/ExecuteCommand.php#L338-L340 which only ever runs the update hook once.

How to reproduce

  • Start on Drupal 8.5.x and add over 100 taxonomy terms
  • Upgrade to Drupal 8.6.x and run update:execute
  • Note that only the first 100 taxonomy terms are correctly migrated correctly to the new parent field structure during taxonomy_update_8502()

Solution

Implement batch updates during update:execute.

See also

#3574 #3787

longwave avatar Sep 10 '18 08:09 longwave

@rlmumford we could close this issue after merge https://github.com/hechoendrupal/drupal-console/pull/4057 ?

enzolutions avatar May 23 '19 18:05 enzolutions

@enzolutions I believe we can

rlmumford avatar May 23 '19 22:05 rlmumford

Awesome.

enzolutions avatar May 23 '19 22:05 enzolutions