CRM_Core_Config_MagicMerge - Fix warning on demos sites
authorTim Otten <totten@civicrm.org>
Tue, 9 Feb 2016 18:42:40 +0000 (10:42 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 9 Feb 2016 18:42:40 +0000 (10:42 -0800)
Apparently, createDir() will return FALSE if the folder already exists *or*
if the creation-act fails.  We only want to display a warning if the
creation-act fails.

CRM/Core/Config/MagicMerge.php

index d4bc55978b7331f6aa3dbe158a1d4c80c5fc29ba..e748cf299fc3fbd7629e9188db6764718e13b655 100644 (file)
@@ -225,7 +225,7 @@ 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])) {
-            if (!CRM_Utils_File::createDir($value, FALSE)) {
+            if (!is_dir($value) && !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,