-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Current active versions of Drupal (10.x and 11.x) currently complain if there are non-core scaffolding packages enabled in the root-level composer.json file.
The observed error messages include:
Unable to download modules via the UI: Any packages other than the implicitly allowed packages are not allowed to scaffold files. See the scaffold documentation for more information. pantheon-systems/drupal-integrations
and
Error message
Your site cannot be automatically updated until further action is performed.Any packages other than the implicitly allowed packages are not allowed to scaffold files. See the scaffold documentation for more information.
pantheon-systems/drupal-integrations
Equivalent results will be returned for sites enabling amazeeio/drupal-integrations.
Speaking as someone who was involved with the Composer Initiative in Drupal 8.8, scaffolding was introduced into Drupal core as a means to bridge Drupal's legacy requirements for well-known file locations with the capabilities provided by Composer; it was not envisioned to itself be a persistent modern capability of Drupal core. In other words, the members of the Composer Initiative imagined that eventually, Drupal would move away from scaffolding and eventually use files directly from their default locations inside of the vendor directory.
For this reason, Pantheon has decided to begin to move away from scaffolding, rather than take some other alternate course of action, such as working around the Drupal limitation, or influencing the direction of Drupal core. To this end, new Drupal CMS sites created on the platform today now use the settings.pantheon.php file directly from its location in vendor/pantheon-systems/drupal-integrations, and pantheon-systems/drupal-integrations is no longer enabled as a scaffolding package. In time, we will extend this change to new Drupal 11 and Drupal 10 sites, and ultimately, the platform will automatically reconfigure existing Drupal 11 and Drupal 10 sites during update operations to use the new scaffold-free operation.
To achieve this:
- We created a new version of settings.pantheon.php, removing some workarounds no longer required in current Drupal versions.
- We find the settings file using an autoloaded Assets class that knows where the assets are stored relative to its own location in the drupal-integrations project.
- Features in the Pantheon settings file that required relative access to customer-placed files in their sites folder were moved to the customer's settings.php file.
- Earlier platform changes separated the concept of files that are part of the initial size vs files that are delivered in upstream updates; e.g. previously, we used drupal/core-composer-scaffold to place the initial settings.php file, but it is now part of the "start state" of the repository.
- Utility functions to adjust the configuration of an existing site to a non-scaffolded site are also included, for future use.
Similar techniques might prove to be useful for this project.
As an alternate solution, this project could be converted from a project that scaffolds to a Composer plugin. Drupal core allows plugins to be added to an allow-list, making them compatible with the core package_manager. It is not currently possible to allow-list projects that scaffold, though.
The original issue related to this on drupal.org is drupal/#3346707