Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Won't Fix
-
Affects Version/s: 2.2.8, 3.0
-
Fix Version/s: 3.1
-
Component/s: Core CiviCRM
-
Labels:None
Description
I have been getting a js error when loading CiviCRM on a site where civiCRM is installed like:
sites/sitename/modules/civicrm
Adding these lines after line 80 fixed it for this site:
if ( file_exists( $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'civicrm.settings.php' ) )
{ return $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; }i.e. if the efforts to calculate the path didn't work right then have a go at this before erroring. I would also add this variant (since it is the one that I thought should have worked).
if ( file_exists( $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .'..' . DIRECTORY_SEPARATOR . 'civicrm.settings.php' ) )
{ return $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR. '..' . DIRECTORY_SEPARATOR; }This isn't very elegant but it seems like a fairly harmless way of trying a couple of likely options before giving the error message.