From 895c19e7936df2eceab00c55d2cc59ae26f89ca8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 3 Feb 2016 20:16:20 -0700 Subject: [PATCH] CRM_Core_Config - Display warning when mkdir fails --- CRM/Core/Config/MagicMerge.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Config/MagicMerge.php b/CRM/Core/Config/MagicMerge.php index b4282b657d..d4bc55978b 100644 --- a/CRM/Core/Config/MagicMerge.php +++ b/CRM/Core/Config/MagicMerge.php @@ -225,7 +225,12 @@ class CRM_Core_Config_MagicMerge { if ($value) { $value = CRM_Utils_File::addTrailingSlash($value); if (isset($this->map[$k][2]) && in_array('mkdir', $this->map[$k][2])) { - CRM_Utils_File::createDir($value); + if (!CRM_Utils_File::createDir($value, FALSE)) { + CRM_Core_Session::setStatus(ts('Failed to make directory (%1) at "%2". Please update the settings or file permissions.', array( + 1 => $k, + 2 => $value, + ))); + } } if (isset($this->map[$k][2]) && in_array('restrict', $this->map[$k][2])) { CRM_Utils_File::restrictAccess($value); -- 2.25.1