Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-17982 - CRM_Core_Config_MagicMerge - Fix warning on demos sites #7774

Merged
merged 2 commits into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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