[update:execute] Batch updates are not supported
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
@rlmumford we could close this issue after merge https://github.com/hechoendrupal/drupal-console/pull/4057 ?
@enzolutions I believe we can
Awesome.