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

Directory separator issues in calendar popup under windows

    Details

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

      Description

      When running CiviCRM version 1.8.10954.

      The javascript for the popup calendar when entering an CiviEvent does not work when running CiviCRM under Windows. The error in the browser console I get is..

      Error: missing ; before statement
      Source File: http://www.blah.ed/sites/all/modules/civicrm/js/lang/calendar-lang.php
      Line: 1, Column: 6
      Source Code:
      Could not find valid configuration dir, best guess: C:\BLAH\DEV\Workspace\www.blah.ed\drupal\sites\all\modules\civicrm/../../sites

      After doing some testing the problem is in function conf_init() in civicrm.config.php.

      if ( strpos( $currentDir, 'sites/all/modules' ) !== false )

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

      else

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

      The problem is $currentDir in my environment is set to "C:\BLAH\DEV\Workspace\www.blah.ed\drupal\sites\all\modules\civicrm/" and will never match "sites/all/modules"

      As a quick test replacing
      if ( strpos( $currentDir, 'sites/all/modules' ) !== false ) {
      with
      if ( strpos( $currentDir, 'sites\all\modules' ) !== false ) {

      the javascript calendar will work.

      Perhaps replacing that line with something like this might be better.
      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:
              shailesh Shailesh Lende
              Reporter:
              edgyct Ed Geraghty
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: