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.



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97878 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Luke Hudson 2010-02-01 03:46:23 +00:00 committed by Sam Minnee
parent c982bbc5df
commit d82ed75b37

View File

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