Skip to content

Commit

Permalink
Merge pull request #7774 from totten/master-dash-err
Browse files Browse the repository at this point in the history
CRM-17982 - CRM_Core_Config_MagicMerge - Fix warning on demos sites
  • Loading branch information
colemanw committed Feb 9, 2016
2 parents 1c0d8fc + 3daed29 commit c5906cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CRM/Core/Config/MagicMerge.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function __get($k) {
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,
Expand Down
6 changes: 5 additions & 1 deletion CRM/Utils/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ public static function isHtml($name) {
* The path name.
* @param bool $abort
* Should we abort or just return an invalid code.
* @return bool|NULL
* NULL: Folder already exists or was not specified.
* TRUE: Creation succeeded.
* FALSE: Creation failed.
*/
public static function createDir($path, $abort = TRUE) {
if (is_dir($path) || empty($path)) {
return;
return NULL;
}

CRM_Utils_File::createDir(dirname($path), $abort);
Expand Down

0 comments on commit c5906cd

Please sign in to comment.