Problem/Motivation

In Drupal 11.3, field.storage.node.body was moved out of the Node module into a new node_storage_body_field sub-module (#3447617).

Contributed modules that ship node types with a body field must now declare a dependency on node_storage_body_field to ensure the field storage
config exists when their module is installed. However, adding this dependency breaks installation on Drupal 10.x and 11.0–11.2, where the sub-module does not
exist.

Moving field.storage.node.body to config/optional does not work reliably. Drupal's
ConfigInstaller::checkConfigurationToInstall() validates all config/install dependencies for all modules being installed in a single operation — including during install profile execution and drush en with dependencies. Optional config is either deferred (during profile install) or only processed after all config/install is validated, causing UnmetDependenciesException failures.

Steps to reproduce

  1. Have a contributed module that ships a node type with a body field (e.g. field.storage.node.body in config/install).
  2. Add node_storage_body_field:node_storage_body_field as a dependency in the module's .info.yml to support Drupal 11.3.
  3. Attempt to install the module on Drupal 10.x or 11.0–11.2 — installation fails because node_storage_body_field does not exist.
  4. Alternatively, move field.storage.node.body to config/optional and attempt to install the module as part of a profile or via
    drush en with dependencies — installation fails with UnmetDependenciesException.

Proposed resolution

Create a forward-compatibility polyfill module (drupal/backport_node_storage_body_field) with two major versions:

  • 1.x (Drupal 10.x / 11.0–11.2): Provides a minimal node_storage_body_field module that ships field.storage.node.body
    in its config/install, mirroring the behavior of the core sub-module added in 11.3.
  • 2.x (Drupal 11.3+): Empty metapackage. Core already provides node_storage_body_field, so this package is a no-op.

Contributed modules can then:

  1. Add "drupal/backport_node_storage_body_field": "^1 || ^2" to their composer.json.
  2. Add node_storage_body_field:node_storage_body_field to their .info.yml dependencies.
  3. Remove field.storage.node.body from their own config/install.

Remaining tasks

  • Create the 1.x branch with the polyfill module and field.storage.node.body config.
  • Create the 2.x branch with the metapackage.
  • Tag initial releases.
  • Update consuming modules to use the polyfill.

User interface changes

None.

API changes

None.

Data model changes

None. The polyfill provides the same field.storage.node.body config that core's node_storage_body_field sub-module provides in 11.3.

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

joevagyok created an issue. See original summary.

joevagyok’s picture

Title: Impelemt the backport » Implement the backport

  • joevagyok committed 27233790 on 2.x
    Issue #3577999: Backport: support body field v2.
    

  • joevagyok committed 177daedb on 1.x
    Issue #3577999: Backport: support body field v1.
    
joevagyok’s picture

Version: » 1.1.0
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.