Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.11
-
Fix Version/s: 4.7.13
-
Component/s: Core CiviCRM
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
Setting 'CiviCRM Extensions Directory' to [cms.root]/existing_directory results in the validation error "'CiviCRM Extensions Directory' directory does not exist"
Explanation of problem and solution below...
[cms.root] does not have a trailing slash and is passed CRM_Utils_File::absoluteDirectory as $basePath.
CRM_Utils_File::absoluteDirectory expects the $basePath parameter to have a trailing slash.
Without a trailing slash in $basePath, the absolute directory returns an invalid directory.
For example, for a site with cms.root = /var/www/civicrm "[cms.root]/test" will be resolved to /var/www/civicrmtest (it should be resolved to /var/www/civicrm/test).
Checking to see whether $basePath has a trailing slash and adding one if it doesn't seems like a fairly future proof way to solve this problem in this instance and in others.