Problem/Motivation

When installing from an installation profile, the installer checks module requirements. If the public files directory is missing, it is created. When installing from a recipe, we get a warning instead:

Security warning: Couldn't write .htaccess file. Create a .htaccess file in your public:// directory which contains the following lines:

Steps to reproduce

  1. Install the drupal_cms_helper module.
  2. Run drush site:export.
  3. Delete sites/default/files.
  4. Run drush si ../recipes/site_export.

Proposed resolution

Check module requirements when installing from recipe or config.

Issue fork drupal-3600349

Command icon 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

darren oh created an issue. See original summary.

darren oh’s picture

Title: Recipe install does not create public files directory » Recipe and config installs do not check requirements
Assigned: darren oh » Unassigned
Issue summary: View changes
Status: Active » Needs review

I have provided a fix. I am not interested in writing tests or arguing about which files should hold the code.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new9.9 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

kieran.cott’s picture

install.inc and install.core.inc seem like reasonable choices, and the fix resolves the issue for me after reproducing the error locally.

I've tweaked the logic a bit - config and recipe install modes should probably be checked before falling back to profile requirements, otherwise existing-config installs with a profile can still miss requirements from modules listed in core.extension.yml.

Also added some kernel test coverage and addressed the PHPCS/Stan failures.

kieran.cott’s picture

Status: Needs work » Needs review