From db233aa7255dfe59a861d7eabcd67d3d1777a448 Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Mon, 9 Feb 2015 13:17:02 +0530 Subject: [PATCH] CRM-15897 - Fix for Joomla Image Url's not upgraded ---------------------------------------- * CRM-15897: Contact ImagesUnviewable - Issue Persisting through 4.5.5 https://issues.civicrm.org/jira/browse/CRM-15897 --- CRM/Upgrade/Incremental/php/FourFour.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index af2a61d3a0..79383f3eb5 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -378,13 +378,17 @@ ALTER TABLE civicrm_dashboard static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId){ $dao = self::findContactImageUrls($startId, $endId); $failures = array(); + $config = CRM_Core_Config::singleton(); while ($dao->fetch()){ $imageURL = $dao->image_url; $baseurl = CIVICRM_UF_BASEURL; + //CRM-15897 - gross hack for joomla we need to remove the administrator/ + if ($config->userFramework == 'Joomla') { + $baseurl = str_replace("/administrator/", "/", $baseurl); + } $baselen = strlen($baseurl); if (substr($imageURL, 0, $baselen)==$baseurl){ $photo = basename($dao->image_url); - $config = CRM_Core_Config::singleton(); $fullpath = $config->customFileUploadDir.$photo; if (file_exists($fullpath)){ // For anyone who upgraded 4.4.6 release (eg 4.4.0=>4.4.6), the $newImageUrl incorrectly used backend URLs. -- 2.25.1