Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2.2, 3.2.3
-
Fix Version/s: 3.2.4
-
Component/s: Core CiviCRM
-
Labels:None
Description
When upload image url to a contact the system get the wrong image path when running civiCRM with Joomla on window with XAMPP
The error code is at file CRM/Contact/BAO/Contact.php on line 753
$customFileUploadDirectory = strstr( $absolutePath , '/media' );
This code cause the problem. cause in window system the absolute path is "...\media" not "/media"
My solution is replace all the "\" with "/"
$customFileUploadDirectory = strstr( str_replace('\', '/', $absolutePath), '/media' );
and then the upload image url will be work fine.
also I think this bug also occur at line 757 for drupal version and 760 for standalone version
$relativePath = $config->userFrameworkBaseURL . $absolutePathStr;
fix with
$relativePath = $config->userFrameworkBaseURL . str_replace('\', '/', $absolutePathStr);