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

dev/financial#120 - Fix CiviCRM base URL on Joomla frontend #16761

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 13, 2020

Overview

This fixes loading of several JS+CSS assets for front-end pages (such as the contribution page) on CiviCRM-Joomla.

See also: https://lab.civicrm.org/dev/financial/issues/120

(This PR is a revision/alternative to #16760 for which Seamus did the primary analysis. This variant iterates on code style.)

Background

  • Joomla splits CiviCRM between two "components" -- a backend administrator component and frontend/user component.
  • Each component has a different civicrm.settings.php and a different CIVICRM_UF_BASEURL.
  • CiviCRM's JS and CSS assets are physically stored under administrator/components/com_civicrm/. Regardless of whether the web-page is a frontend or backend screen, it should load JS/CSS assets from the administrator side.
  • In Civi v5.23.alpha (1143a78), the URL construction for certain folders (esp civicrm/bower_components and civicrm/packages) changed subtly.

Before

CiviCRM JS and CSS assets do not load on Joomla front end forms.

The asset URLs incorrectly point to (nonexistent) JS/CSS files in the user component.

The URL variable [civicrm.root] (and therefore [civicrm.packages], [civicrm.bower]) does not truly point to the public URL of CiviCRM assets.

After

CiviCRM JS and CSS assets do load on front end forms.

The asset URLs correctly point to (existent) JS/CSS files in the administrator component.

The URL variable [civicrm.root] (and therefore [civicrm.packages], [civicrm.bower]) does point to the public URL of CiviCRM assets.

(Original description from seamus. Revised by totten.)

@civibot
Copy link

civibot bot commented Mar 13, 2020

(Standard links)

Copy link
Contributor

@seamuslee001 seamuslee001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me I think this will work

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 shall we merge through to 5.23 ready for @totten to drop when he is around?

@totten
Copy link
Member

totten commented Mar 13, 2020

This is some really good analysis/fixing @seamuslee001.

I do think this variant of the patch is a bit nicer (r-code) as it includes a bit of cleanup on some old mess.

@totten
Copy link
Member

totten commented Mar 13, 2020

  • Note that there was more discussion/review on Mattermost (product-maintenance).
  • r-run: I've run on Joomla 3.9 with/without the patch and confirmed that (a) before the patch, various URLs were malformed on the contribution page (b) after the patch, they worked.
  • r-explain: The explanation was better on the original PR. I'll copy some bits + revise here then merge.

@totten totten changed the title Alternate Joomla! fix - move to CMS override dev/financial#120 - Fix CiviCRM base url on Joomla frontend Mar 13, 2020
@totten totten merged commit a84dc1a into civicrm:5.24 Mar 13, 2020
@seamuslee001 seamuslee001 deleted the joomla branch March 13, 2020 09:39
@totten totten changed the title dev/financial#120 - Fix CiviCRM base url on Joomla frontend dev/financial#120 - Fix CiviCRM base URL on Joomla frontend Mar 13, 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.

3 participants