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

civicrm.config code doesn't do a good job when civicrm not in sites/all

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.3
    • Fix Version/s: 4.4.4
    • Component/s: None
    • Labels:
      None

      Description

      The chunk of code is looking to see if the folder is in sites/all & if so it will look in the directory 2 levels above for the civicrm.settings file.

      If not it will look in ../../sites

      Although the code comment appears to be on the wrong line leading to confusion this appears to be the drupal 5 location (& I have not seen civicrm.settings.php directly under 'sites' in d6 or d7).

      This appears to lead to the requirement for a settings_location merely because the civicrm folder is under the site folder not all

      if ( defined( 'CIVICRM_CONFDIR' ) && ! isset( $confdir ) )

      { $confdir = CIVICRM_CONFDIR; }

      else {
      // make it relative to civicrm.config.php, else php makes it relative
      // to the script that invokes it
      // simple check to see if this is under sites/all or just modules
      if ( strpos( $currentDir, 'sites' . DIRECTORY_SEPARATOR . 'all' . DIRECTORY_SEPARATOR . 'modules' ) !== false )

      { // seems like this is in drupal5 dir location $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'; }

      else

      { $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'sites'; }

      }

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: