package manager fails if you are scaffolding assets

Created on 14 March 2025, 25 days ago

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

πŸ› Bug report
Status

Active

Version

11.1 πŸ”₯

Component

package_manager.module

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024