composer-patches
composer-patches copied to clipboard
Cannot apply drupal/core patch that changes sites/default/settings.php
The composer package of drupal/core only contains a subdir of the upstream project. This leads to a problem that was fixed by composer-patches via the "patchLevel" configuration.
This leads to a new problem when patches for drupal/core change files outside of that upstream subdir. For example, the #22 patch in https://www.drupal.org/project/drupal/issues/2857359, tries to patch sites/default/settings.php and fails because of that.
Hmm this cannot and should not work. The file sites/default/settings.php is speciffic to a project not to the core, the patch mentioned, changes scaffold's assets inside the assets directory. When thiese files are changed they should be copied by drupal/core-composer-scaffold or by project's maintainer manually.
Further more the file default.settings.php is changed, which is a template and documentation for project's maintainer. The settings.php should be maintained manually
@emembeka You're somewhat right. These are clearly two composer plugins that would need to run in a specific order to make this work. In this case, the drupal scaffold plugin should run before composer-patches so that the scaffolded files would be patchable.
I had also made a typo when writing the file name, which should have been default.settings.php and not settings.php, which you did identify correctly as being the target of the patch.
Scaffolded drupal files are not part of a composer package and won't be patchable by this plugin. If you want to change those files, why not change them and commit them?