Generated with the help of an LLM.

Problem/Motivation

DbUpdateController::selection() builds the list of pending database updates inline. The list covers hook_update_N() and post-update functions. It also covers updates blocked by unmet dependencies. Other callers, such as the updatedb:status command found in Drush, must copy that logic.

Proposed resolution

Add DatabaseUpdate::getPendingUpdates(). It returns an array keyed by extension name. Each entry has the extension type, an optional warning, and a list of updates. Each update has a type, name, function, description, an "allowed" flag and its missing dependencies. DbUpdateController::selection() uses the new method. The rendered page does not change.

Remaining tasks

Decide how and if we do a deprecation for the constructor args addition.

User interface changes

None.

API changes

One new public method. DatabaseUpdate::__construct() takes a new optional $postUpdateRegistry argument.

Data model changes

None.

Issue fork drupal-3638091

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

moshe weitzman created an issue. See original summary.

moshe weitzman’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Earliest deprecations now are 12.1.0

moshe weitzman’s picture

DatabaseUpdate is introduced in 11.5 which his not yet released. I dont think such conservatism is warranted. I could remove the deprecation message if that will make this go down smoother.

smustgrave’s picture

but 11.5 is in beta and my understanding it needs to be extreme case to add new deprecations