Installing a module in an update function should not result in automatically installing entity type/field definitions

Created on 6 November 2019, over 4 years ago
Updated 30 July 2023, 11 months ago

Problem/Motivation

While working on #3084983: Move all the code related to path aliases to a new (required) "path_alias" module → we realized that installing a module in an update function should not result in automatically installing entity type/field definitions, because an update function should always install a well-defined set of entity type and definitions, to be repeatable and predictable, whereas the module installer just installs whatever definitions are available in code.

Proposed resolution

Add a flag to ModuleInstallerInterface::install() to notify that the module installation is happening in the update context, so that entity type/field definition installation can be skipped.

Remaining tasks

TODO

User interface changes

None

API changes

ModuleInstaller[Interface]::install() gets an extra optional $during_update tag. This is also passed to the various other module installation hooks.

This affects any modules extending ModuleInstaller - there are two of these - module_blacklist and disable_modules. disable_modules is abandoned in favour of config_split, module_blacklist is alpha.

There's also one module implementing ModuleInstallerInterface directly, but this is is not actually replacing the module installer so looks like a mis-use of the interface. https://www.drupal.org/project/steam_login →

Data model changes

None

Release notes snippet

TODO

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component
Entity  →

Last updated about 5 hours ago

  • Maintained by
  • 🇬🇧United Kingdom @catch
  • 🇨🇭Switzerland @Berdir
  • 🇩🇪Germany @hchonov
Created by

🇮🇹Italy plach Venezia

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs release note

    The major change should have a special release note written to summarize the importance of the change. See Write a release note for an issue.

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.

Production build 0.69.0 2024