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

Directory separator issues in URL resource location under windows

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When running CiviCRM version 1.8.10954. The resource URL doesn't get the correct default values causing Javascript and image to fail to load. The problem is the directory separator used in function setValues in CRM/Admin/Form/Setting.php.

      global $civicrm_root;
      if ( strpos( $civicrm_root, '/sites/all/modules' ) !== false ) {
      $defaults['userFrameworkResourceURL'] = $baseURL . "sites/all/modules/civicrm/";
      } else {
      $defaults['userFrameworkResourceURL'] = $baseURL . "modules/civicrm/";
      }

      Suggest ed fix is the following. The strpos is the only thing that needs to be aware of the DIRECTORY_SEPARATOR. The URLs can keep the forward slash.
      global $civicrm_root;
      if ( strpos( $civicrm_root, DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'all' . DIRECTORY_SEPARATOR . 'modules' ) !== false ) {
      $defaults['userFrameworkResourceURL'] = $baseURL . "sites/all/modules/civicrm/";
      } else {
      $defaults['userFrameworkResourceURL'] = $baseURL . "modules/civicrm/";
      }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              edgyct Ed Geraghty
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: