Problem/Motivation

Betas have added one update hook per config change: display_builder_update_11101 to 11106 and display_builder_post_update_1 to _9. All of them only migrate beta data. From RC1, config schema and APIs are frozen, so these hooks are dead code for any site already past the betas.

Keeping them costs more than dead code:

  • Each schema change can break an older hook that saves a profile. #3624051: Failed: InvalidArgumentException after update (drush updatedb) to 1.0.0-beta7: post update 3 saved profiles while state.revert still had its beta6 shape, and the update failed on every beta6 site.
  • Post updates run in string order, so _10 runs before _2. That already happened: the two post updates numbered _10 and _11 in 1.0.x-dev sorted between _1 and _2, and ProfileUpgradePathTest went red. They were renamed after what they do, which is how every post update is named from now on.
  • Helpers like ProfileIslandsUpdater::splitControlsIsland() and ::removeValueOnlyKeys() exist only for one beta hook.

Deleting the hooks without declaring them is not an option: a site jumping from an early beta to RC1 would skip them silently and keep invalid config.

Proposed resolution

Make 1.0.0-beta10 the required stepping stone. It ships every beta hook, including the #3624051: Failed: InvalidArgumentException after update (drush updatedb) to 1.0.0-beta7 fix, and ProfileUpgradePathTest runs the default profile of beta4 to beta7 through them.

At RC1:

  • Delete display_builder_update_11101 to 11106 and declare hook_update_last_removed():
    function display_builder_update_last_removed(): int {
      return 11106;
    }
    
  • Delete display_builder_post_update_1 to _9 and declare them in hook_removed_post_updates(), all mapped to 1.0.0-beta10, the release a site must install first:
    function display_builder_removed_post_updates(): array {
      return array_fill_keys([
        'display_builder_post_update_1',
        // ...
        'display_builder_post_update_9',
      ], '1.0.0-beta10');
    }
    

    Core then blocks update.php and drush updb on a site that skipped beta10, with a message naming it. Nothing is skipped silently.

  • Keep the named post updates: they are the 1.x ones.
  • Remove ProfileIslandsUpdater::splitControlsIsland() and ::removeValueOnlyKeys(). Keep ProfileIslandsUpdater itself: it is the tool for 1.x updates.
  • Replace the beta fixtures of ProfileUpgradePathTest with the RC1 default profile, so the test guards every 1.x update the same way.

From RC1 on:

  • Never reset update hooks again in 1.x.
  • Name post updates after what they do, for example display_builder_post_update_add_scaffold_options(), not by number.
  • Start new hook_update_N at 11200.
  • Convert stored data the schema no longer accepts in a hook_update_N, which always runs before post updates, not in a post update.

Remaining tasks

User interface changes

None.

API changes

Removed: ProfileIslandsUpdater::splitControlsIsland(), ProfileIslandsUpdater::removeValueOnlyKeys().

Data model changes

None. Sites must be on 1.0.0-beta10 before updating to RC1.

CommentFileSizeAuthor
#15 3624068 after.png312.71 KBcsakiistvan
#15 3624068 before.png500.04 KBcsakiistvan
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

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Title: Remove the beta update hooks at RC1, with 1.0.0-beta8 as the required stepping stone » Remove the beta update hooks at RC1, with 1.0.0-beta9 as the required stepping stone
Issue summary: View changes
Issue tags: -display_builder-1.0.0-beta8 +display_builder-1.0.0-beta9
mogtofu33’s picture

Issue summary: View changes

mogtofu33’s picture

Assigned: Unassigned » pdureau
Status: Active » Needs review

  • mogtofu33 committed a1652658 on 1.0.x
    task: #3624068 Name the unreleased post updates after what they do
    
    Co-...

  • mogtofu33 committed aef5028c on 1.0.x
    tests: #3624068 Add a custom beta6 profile to ProfileUpgradePathTest
    
mogtofu33’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Needs work
Issue tags: -display_builder-1.0.0-beta9 +display_builder-1.0.0-beta10
mogtofu33’s picture

Title: Remove the beta update hooks at RC1, with 1.0.0-beta9 as the required stepping stone » Remove the beta update hooks at RC1, with 1.0.0-beta10 as the required stepping stone
Issue summary: View changes
pdureau’s picture

Changing the tag to have the full remaining scope in a single query: https://www.drupal.org/project/issues/search/display_builder?text=&assig...

pdureau’s picture

It seems similar work has already been done in e4af481f (not covered by a ticket 😔):

commit e4af481f69f77f7641cc326966ecaa02c9706b9b
Author: Jean Valverde <moimog33@gmail.com>
Date:   Mon Sep 28 10:59:07 2026 +0200

    tests: Add missing CoversClass, drop setAccessible, run post updates in core order

So, I have rebased and repush, and now the MR is empty.

What is left to do here? Just removing stuff from display_builder.install, display_builder.post_update.php...)?

pdureau’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Needs review

What is left to do here? Just removing stuff from display_builder.install, display_builder.post_update.php...)?

I have created a new MR : https://git.drupalcode.org/project/display_builder/-/merge_requests/531/

With the expected removals, as far as I understood them:

  • update hooks from display_builder.install
  • numeric post update hooks from from display_builder.post_update.php (⚠️ the named post update hooks stayed, do they need to be removed too?)
  • ::splitControlsIsland() and ::removeValueOnlyKeys() from ProfileIslandsUpdater
  • the tests covering removed hooks: ProfileTest::testHiddenRevertStaysHidden()
  • Fixture: default.1.0.0-beta4, default.1.0.0-beta5, default.1.0.0-beta6 and the related logic in ProfileUpgradePathTest have been replaced by default.1.0.0-rc1.yml (⚠️ knowing we may have a beta10 before the rc1, as suggested by the previous tag on the ticket)
  • ⚠️ I have also removed custom.1.0.0-beta6 and default.1.0.0-beta7 as advised by my LLM, but I have to admit I don't understand why the removal of those 2 caused so many additional changes in ProfileUpgradePathTest

✅ It is comforting no other tests have been updated and the pipeline is still green. ⚠️ But I guess the pipeline is not testing updates from release to release, so we must be careful.

✅ None of the 40 issues tagged with 1.0.0-beta has a current merge request that touches display_builder.install or display_builder.post_update.php. ⚠️ But this may change in the near future, so let's be careful.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new500.04 KB
new312.71 KB

✅ Tested and works — applied MR !531, rebuilt caches and opened /update.php on a site set to schema 11103 with display_builder_post_update_7 to _9 not run: before the MR it offered 11104–11106 and the beta post updates, after it the requirements step stops with "Unsupported schema version: Display Builder … last removed version: 11106, installed version: 11103", and drush updb runs nothing. A site skipping the betas is now blocked instead of silently missing updates.

pdureau’s picture

Assigned: Unassigned » pdureau

Thanks a lot. I will do an extra manual check before sending to Jean.

pdureau’s picture

Careful, #3548769: Security: availability of endpoints according to islands is adding a hook in display_builder.post_update.php