From 00f6fb2ae8bf8755cc23da90b03104b4686a9a97 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 2 Jul 2019 18:02:49 -0700 Subject: [PATCH] (dev/cloud-native#3) MagicMerge - Allow pulling properties directly from Civi::paths --- CRM/Core/Config/MagicMerge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Config/MagicMerge.php b/CRM/Core/Config/MagicMerge.php index 801f803f3b..2bc5a8f32e 100644 --- a/CRM/Core/Config/MagicMerge.php +++ b/CRM/Core/Config/MagicMerge.php @@ -241,10 +241,14 @@ class CRM_Core_Config_MagicMerge { case 'setting': return $this->getSettings()->get($name); + // The interpretation of 'path' and 'setting-path' is similar, except + // that the latter originates in a stored setting. + case 'path': case 'setting-path': // Array(0 => $type, 1 => $setting, 2 => $actions). - $value = $this->getSettings()->get($name); - $value = Civi::paths()->getPath($value); + $value = ($type === 'path') + ? Civi::paths()->getVariable($name, 'path') + : Civi::paths()->getPath($this->getSettings()->get($name)); if ($value) { $value = CRM_Utils_File::addTrailingSlash($value); if (isset($this->map[$k][2]) && in_array('mkdir', $this->map[$k][2])) { @@ -322,6 +326,7 @@ class CRM_Core_Config_MagicMerge { case 'setting': case 'setting-path': case 'setting-url': + case 'path': case 'user-system': case 'runtime': case 'callback': -- 2.25.1