Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20191

civicrm.root variable does not support /sites/x/modules/contrib/civicrm format

    Details

    • Type: Bug
    • Status: Open
    • Priority: Important
    • Resolution: Unresolved
    • Affects Version/s: 4.7.16
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Previously CiviCRM worked if it was installed under /sites/x/modules/contrib

      Since 4.7.16 it doesn't any more, in one particular case:

      We picked this up due to this commit:
      https://github.com/civicrm/civicrm-core/commit/286a7e5ad60dbeb6ca15687f42079ab0a6f48af1

      In the latest version, CKeditor does not load. Previously it was being loaded using a relative path, but now it's using the civicrm.root variable, which hard-codes the CiviCRM root directory to:
      $baseURL . "sites/$siteName/modules/$civicrmDirName/";
      (see
      https://github.com/civicrm/civicrm-core/blob/4a6f91c1dd1c76093e4f7f093e7446a5a72a8582/CRM/Utils/System/Base.php#L665
      )

      However, everything else is working OK, because the 'CiviCRM resource URL' is set correctly in our 'resource URL' settings - using the path with 'contrib' in.

      So there is a mis-match between:

      • The civicrm.root variable, which can be output as a URL
      • The 'CiviCRM resource URL' which can be configured via the UI at admin/setting/url
      • The global civicrm_root which is set in civicrm.settings

      I think there should only be 'one' place to set and retrieve the civicrm.root URL. That should probably be the civicrm.root variable, which means we should fix it up.

      Why does the code in System/Base not just use the global $civicrm_root which is declared in the civicrm.settings file? Why does it try to hardcode the URL?

      Happy to do some work on this, but would like a pointer as to the right approach to take.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              john John K.
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: