Update hook Sequence
I’m looking for guidance (and possibly documentation examples) on the recommended core/contrib‑safe way to update hooks sequence.
So, I have some hooks number which is already ran and those already ran number was not correct so I am writing post update hook which will reset my hook number to 10013\Drupal::service('update.update_hook_registry')->setInstalledVersion('module_name', 10013) so now the next hook which would run is 10014,So, I want to add hook_10014 which should throw an exception, is there any safe way like core is doing something like this?
Example:
already ran hook was 100013 which is a wrong number because after 10009 correct number ishook_10010, hook_10011, hook_10012, hook_10013 and so on... so I am fixing those numbers by resetting hooks schema. Is there any way in Drupal core where we are fixing this type of problem.
Comments
Comment #2
anmol singh commentedComment #3
quietone commentedI only have a minute. Have you read the function hook_update_N API documentation?
Some text from that document
Support requests are always 'normal' priority.
And keep in mind that the Drupal Core issue queue is not the ideal place for support requests. The 'support request' option is there for filing support issues for contributed modules and themes. There are several support options listed on our Support page, including the Drupal Forums and Drupal Answers. There is also Drupal Slack. You may get better replies in one of those places.
Comment #4
quietone commentedThe Drupal Core issue queue is not the ideal place for support requests. The 'support request' option is there for filing support issues for contributed modules and themes. There are several support options listed on our Support page, including the Drupal Forums and Drupal Answers. There is also Drupal Slack. You may get better replies in one of those places.
I am closing this per the guidance in Handle or refer a support request in an issue.