Fix for website url issue
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 22 May 2015 10:11:27 +0000 (15:41 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 22 May 2015 10:11:27 +0000 (15:41 +0530)
CRM/Contact/Selector.php

index af8083ad812c13496506a4c0ecc5e9cdf7997214..d03e948fca57236ef2fab080130f8c7a60524aa5 100644 (file)
@@ -582,6 +582,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
             if ($id == 'Primary') {
               $locationTypeName = 1;
             }
+            elseif ($fieldName == 'url') {
+              $locationTypeName = "website-{$id}";
+            }
             else {
               $locationTypeName = CRM_Utils_Array::value($id, $locationTypes);
               if (!$locationTypeName) {
@@ -691,7 +694,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
         }
         elseif (strpos($property, '-url') !== FALSE) {
           $websiteUrl = '';
-          $websiteKey = 'website-1';
+          $websiteKey = str_replace('-url', '', $property);
           $propertyArray = explode('-', $property);
           $websiteFld = $websiteKey . '-' . array_pop($propertyArray);
           if (!empty($result->$websiteFld)) {