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

Multi-Site Subdirectory Install Issue

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 3.4.3, 4.0.3
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      (As described here: http://forum.civicrm.org/index.php/topic,19655.msg81800.html)

      The install script '<CiviCRM root>/install/index.php' is using different logic than Drupal for mapping the URL to the site configuration folder, causing problems with multi-site sub-directory setups (and presumably anyone using Drupal 7's new sites.php feature).

      Use case:

      Shared-codebase, single-domain, subdirectory-URL multi-site installation of D7 / CiviCRM 4. (ie. a single D7 / CiviCRM codebase in apache's doc root directory, using symlinks in the doc root directory to point the subdirectory sites back to Drupal's index.php. In the sites folder I have folders called mydomain.org, mydomain.org.subdir1, mydomain.org.subdir2, etc.)

      Drupal will install successfully on the root site (mydomain.org) and sub-directory sites (ie. mydomain.org/subdir1), but when trying to install CiviCRM on sub-directory sites such as "mydomain.com/subdir1" by going to "http://mydomain.org/subdir1/sites/all/modules/civicrm/install/index.php" CiviCRM complains that it is already installed with the message:

      "Oops! CiviCRM is Already Installed
      CiviCRM has already been installed in this Drupal site.

      To start over, you must delete or rename the existing CiviCRM settings file - civicrm.settings.php - from [your Drupal root directory]/sites/mydomain.org."

      Thus, the install script isn't noticing the sub-directory in the URL.

      Fix:

      It looks like getSiteDir( $cmsPath, $str ) attempts to re-implement conf_path() in from older versions of Drupal. I've altered 'install/index.php' and changed getSiteDir() to simply call Drupal's conf_path() which seems to have things working properly. The caveat is that it uses a Drupal specific call even though Drupal specific code seems to be handled only conditionally in 'install/index.php'. Perhaps the historical reason for this is the stand alone installer? I'm not sure.

        Attachments

        1. civicrm-CRM-7980-conf_path.patch
          3 kB
          Stevel
        2. civicrm-CRM-7980-conf_path.patch
          4 kB
          Stevel
        3. civicrm-CRM-7980-conf_path.patch
          5 kB
          Stevel
        4. civicrm-CRM-7980-conf_path.patch
          4 kB
          Stevel
        5. civicrm-CRM-7980-conf_path.patch
          4 kB
          Stevel
        6. index.php.diff.txt
          3 kB
          spork

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              spork spork
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: