Problem/Motivation
Split from #3027639: Make css/js optimized assets path configurable
The public stream wrapper has some logic to magically determine the correct base path for files, we didn't copy that to the assets stream wrapper but it should probably be as close as possible.
This broke multisite installs without a configured file_public_path.
Steps to reproduce
1. Download Drupal 10.1 via composer
2. Create docroot/sites/www folder and copy docroot/sites/default files to new folder.
3. Update docroot/sites/sites.php to point to docroot/sites/www by default.
4. Install Drupal using standard profile.
5. See JS/CSS aggregated files not rendering.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3354090.patch | 2.22 KB | catch |
| #8 | 3354090.patch | 1.94 KB | catch |
| #8 | 3354090-test-only.patch | 1.39 KB | catch |
| #6 | 3354090_0.patch | 565 bytes | catch |
| #2 | 3354090.patch | 828 bytes | catch |
Comments
Comment #2
catchComment #3
smustgrave commentedDon't mind marking this for ya.
Just for my own clarity it's fine to remove getType without a change record since it was just recently added to 10.1 which hasn't been released yet?
Comment #4
catchOops actually that bit's for #3354091: Asset stream wrapper may need to be selected in the UI for some cases although not the right change for there either, need to drop that hunk from the patch here.
Comment #6
catch#3365739: JS/CSS assets 404 by default on multisites.
Comment #7
longwaveIf possible this could do with test coverage from the steps to reproduce in #3365739: JS/CSS assets 404 by default on multisites
Comment #8
catchMight have a test that fails - looks like setting file_public_path to NULL is the way to do it.
Comment #10
catchThat's what we want from the failing patch.
Remaining question for me, potentially for a follow-up but could also just do here:
1. Should we merge the two test methods back into one to avoid the extra install?
2. If not #1, should we use a data provider instead of a protected helper?
Comment #11
catchComment #13
catchComment #14
longwaveI think merging them is fine, if we add a comment to mention why we need to reset file_public_path here?
Comment #15
catchA bit short of time, but here's a merged test. Left the helper in because it's simpler, but one test method now.
Comment #16
longwaveI think this is fine.
Comment #19
larowlanCommitted to 11.x and backported to 10.1.x