Improve DX of manually applying entity/field storage definition updates

Created on 27 September 2014, about 10 years ago
Updated 8 November 2023, about 1 year ago

Problem/Motivation

In #1916790: Convert translation metadata into regular entity fields we added automatic notification of field storage definition creation to avoid forcing users to run updates before being able to translate content:

[The committed] patch makes the UX of enabling translation on an entity type for the first time slightly worse as updates need to be run before things actually work. I think we should add a method on the definition update manager to apply changes only pertaining a single provider (module). This would allow CT to update the schema automatically. I think this particular case does not need a manual confirmation by the user, unless a huge number of entity is already existing, which could make adding columns a very long operation.

The code added over there could be generalized and add onto the definition update manager, so other modules with similar use cases can leverage it. We also need to figure out how to deal with potentially long schema updates.

Proposed resolution

  • Add a method to the definition update manager to apply updates only for a specific provider.
  • Add a method to the entity manager to mark one or more entity/field storage definition as up-to-date, that is telling the system no more updates are required. This should cover especially changes to the field storage definition schema.

Remaining tasks

  • Solution definition
  • Implementation
  • Reviews

User interface changes

None

API changes

None, just additions

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Entity 

Last updated 4 minutes ago

Created by

🇮🇹Italy plach Venezia

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

  • Upgrade path

    It affects the ability to upgrade Drupal sites to a new major version. Preferred over version-specific tags such as D7 upgrade path.

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.

  • 🇺🇸United States mfb San Francisco

    This issue seems still relevant today? I wanted to figure out how a contrib field type would go about updating its schema.

Production build 0.71.5 2024