CRM-20381 - ensure option to NOT geocode on imports is respected.
authorJamie McClelland <jm@mayfirst.org>
Tue, 18 Apr 2017 17:13:36 +0000 (13:13 -0400)
committerJamie McClelland <jm@mayfirst.org>
Tue, 18 Apr 2017 17:13:36 +0000 (13:13 -0400)
CRM/Core/Config/MagicMerge.php

index 72fe7827ed6ccad5b1f9f2edd91b1b7972c78455..0d6b722d21a711a6f98474e7357e0809f46cf692 100644 (file)
@@ -222,7 +222,7 @@ class CRM_Core_Config_MagicMerge {
     if (!isset($this->map[$k])) {
       throw new \CRM_Core_Exception("Cannot read unrecognized property CRM_Core_Config::\${$k}.");
     }
-    if (isset($this->cache[$k])) {
+    if (array_key_exists($k, $this->cache)) {
       return $this->cache[$k];
     }
 
@@ -309,7 +309,11 @@ class CRM_Core_Config_MagicMerge {
     }
     unset($this->cache[$k]);
     $type = $this->map[$k][0];
-    $name = isset($this->map[$k][1]) ? $this->map[$k][1] : $k;
+
+    $name = $k;
+    // If foreign name is set, use that name (except with callback types because
+    // their second parameter is the object, not the foreign name).
+    $name = isset($this->map[$k][1]) && $type != 'callback' ? $this->map[$k][1] : $k;
 
     switch ($type) {
       case 'setting':