Allow altering the post_update run order

Created on 20 April 2020, over 4 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

Currently all the post_update methods are run on alphabetical order (see UpdateRegistry::getAvailableUpdateFunctions).
The documentation suggests adding numerical prefix the update names or making them completely numerical in order to control the order of execution. However, this does not take into account that post_update methods can come from different components which makes controlling the order harder.

In contrast, update methods can define requirements to one another which ensures that the order in which they run is consistent.

Proposed resolution

We could either implement a more complex requirement based solution for post_updates (like we do with updates) or we could add an alter hook that allows to alter the final order of execution.

Feature request
Status

Needs work

Version

9.5

Component
Database update 

Last updated 8 days ago

No maintainer
Created by

🇬🇧United Kingdom ieguskiza

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024