Problem/Motivation

Drupal 11.4 relies on a new scaffolded file: autoload_runtime.php. When web/sites/default is read-only, as it should be, scaffolding fails and Drupal cannot start.

Steps to reproduce

  1. On a Drupal 11.3 site, make sure web/sites/default is read only.
  2. In the Automatic Updates UI, update to Drupal 11.4.
  3. When the update fails, attempt to go to the error page. The page will fail to load.
  4. Make web/sites/default writable.
  5. Run composer scaffold.
  6. Reload the page. Update can now continue.

Proposed resolution

  • If Drupal made web/sites/default read-only automatically, it can automatically be made writable for the update.
  • The ability to make run composer scaffold should be an update readiness check.

Remaining tasks

  1. Write tests. Tests should fail if
    • The site reports ready for updates when sites/default cannot be made writable.
    • An update is applied without making sites/default writable.
    • sites/default does not revert back to read-only after the update.
  2. Write update readiness check for scaffolding. Check should fail if sites/default cannot be made writable.
  3. Add step to make sites/default writable before applying update. sites/default should revert to read-only after the update.

API changes

New update readiness check ensures that composer scaffold can run.

Comments

darren oh created an issue. See original summary.

darren oh’s picture

Issue summary: View changes
darren oh’s picture

Issue summary: View changes
darren oh’s picture

Title: Scaffolding fails » Scaffolding failure updating to Drupal 11.4
darren oh’s picture

The composer scaffold command has been fixed in core.

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.