CRM-19303 - Paths - Allow sysadmin to explicitly `[civicrm.*]` variables
authorTim Otten <totten@civicrm.org>
Thu, 15 Jun 2017 07:06:03 +0000 (00:06 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 15 Jun 2017 08:27:09 +0000 (01:27 -0700)
Civi/Core/Paths.php

index 07b16f10a32815f1eae51b4534569c4d35783475..718b4bc29436744bd75584964b426db3da27cb4c 100644 (file)
@@ -78,6 +78,9 @@ class Paths {
   public function getVariable($name, $attr) {
     if (!isset($this->variables[$name])) {
       $this->variables[$name] = call_user_func($this->variableFactory[$name]);
+      if (isset($GLOBALS['civicrm_paths'][$name])) {
+        $this->variables[$name] = array_merge($this->variables[$name], $GLOBALS['civicrm_paths'][$name]);
+      }
     }
     if (!isset($this->variables[$name][$attr])) {
       throw new \RuntimeException("Cannot resolve path using \"$name.$attr\"");