Problem/Motivation
If you use drupal scaffold to append stuff to .htaccess then package manager breaks.
This is critical because it break automatic updates and you need a way to append stuff to .htaccess if you have custom rules in there because otherwise an automatic update will override you .htaccess changes.
Steps to reproduce
Do something like
"drupal-scaffold": {
"locations": {
"web-root": "public_html/"
},
"file-mapping": {
"[web-root]/.htaccess": {
"append": "assets/htaccess-additions.txt"
}
}
},
In composer.json. The assets/htaccess-additions.txt is relative to the root composer.json and contains something like
# Make docx work.
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
If you do this you get errors that contain
In ScaffoldFilePath.php line 135: Scaffold file assets/htaccess-additions.txt not found in package drupal/cms
in your logs.
Proposed resolution
We need to copy anything mentioned in scaffold to the staging area otherwise composer commands on it will not work
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3512922
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
Comment #2
alexpottOkay there is a work around. You can do
vendor/bin/drush cset package_manager.settings include_unknown_files_in_project_root 1But this is still a major bug. We should support copying files that are used in scaffold without having to set anything additional. And as there is no settings form and the error message doesn't point you to this it would be extremely hard for someone to solve this if they can't just ping @catch.
Comment #3
alexpottThis is a duplicate of #3343802: When determining scaffold file mappings, determine them consistently and completely, accounting for overrides going to close and move that issue to core.