BUGFIX: Folder::findOrMake() will call mkdir if needed, even if object already exists in database.

This covers the corner case where DB is out of sync with filesystem. (from r97878)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102541 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 23:45:53 +00:00
parent 279031cc3a
commit ba3c070dbd

View File

@ -63,7 +63,9 @@ class Folder extends File {
$item->Name = $part;
$item->Title = $part;
$item->write();
if(!file_exists($item->getFullPath())) Filesystem::makeFolder($item->getFullPath());
}
if(!file_exists($item->getFullPath())) {
mkdir($item->getFullPath(),Filesystem::$folder_create_mask);
}
$parentID = $item->ID;
}