Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading with alternate packages path (UI-level) #16409

Merged
merged 4 commits into from
Jan 30, 2020

Conversation

totten
Copy link
Member

@totten totten commented Jan 28, 2020

Overview

The configuration option $civicrm_paths['civicrm.packages'] allows one to specify the local path and remote URL of the packages 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 the packages 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:

  • Remove any explicit reference to packages and just rely on the include-path (for *.php files)
  • Construct references to 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.

Before
------

In Smarty, there is no way to request values from `Civi::paths()`.

After
-----

In Smarty, you can request values from `Civi::paths()` using these notations:

```
{crmResURL expr="[civicrm.root]/foo"}
{crmResPath expr="[civicrm.root]/foo"}
```
…es path

This change should work as well as before, and it's more correct.  However,
it's not a full fix making the badge-editor work in D8 - the relevant code
probably needs more of a rethink. But... this is cleaner...
@civibot
Copy link

civibot bot commented Jan 28, 2020

(Standard links)

@civibot civibot bot added the master label Jan 28, 2020
@totten
Copy link
Member Author

totten commented Jan 29, 2020

Since this is mostly UI based, I think you can pretty well check for regression-risk by browsing the relevant screens (profile-editor, event-badge) on the autobuild test site.

@eileenmcnaughton
Copy link
Contributor

SO the badges page didn't work for me with or without the patch :-(

However, the url seemed the same in both places

sites/all/modules/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images

I tested the profile editor via manage events & that worked fine. This is a pretty straight forward string replacment so it seems good to me

@eileenmcnaughton eileenmcnaughton merged commit 7cf3dc2 into civicrm:master Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants