Details
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 )
else
{ $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'sites'; }