Fix loading with alternate packages path (UI-level) #16409
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The configuration option
$civicrm_paths['civicrm.packages']
allows one to specify the local path and remote URL of thepackages
folder. This is not done often, but it is helpful for the composer/D8/git deployment styles. Alas, there are still sundry hard-coded references to thepackages
folder.This fixes some (but not all) references to
packages
. It generally targets on some random frontend screens. (For contrast, #16407 focuses more on system-level classes.)Comments
Generally, it's preferable to either:
packages
and just rely on the include-path (for*.php
files)packages
using the "paths" subsystem (e.g.Civi::paths()->getPath('[civicrm.packages]/foobar')
.However, some files have peculiar issues which make that problematic -- so several of these items required alternative solutions.
This PR is an extracted subset of #16328, which was an exploratory branch aimed at supporting deployment of Civi git repos in D8 via composer. The changes are extracted to make the size of the review more manageable. It's probably best to use this smaller PR to consider topics like regression-risk and general code convention rather than trying to assess the fuller aims of #16328.