Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Fixed merge error

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112616 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit fd6fa623884f719f8e5e3952e88312f05f807765 1 parent a0dd4ff
Ingo Schommer chillu authored
Showing with 0 additions and 26 deletions.
  1. +0 −26 filesystem/Folder.php
26 filesystem/Folder.php
View
@@ -31,32 +31,6 @@ function populateDefaults() {
if(!$this->Name) $this->Name = _t('AssetAdmin.NEWFOLDER',"NewFolder");
}
- function onBeforeWrite() {
- // Ensure folders can't contain path information, just a name
- $this->Name = basename($this->Name);
-
- // Get the folder to be created
- if($this->ParentID) {
- if(!is_numeric($this->ParentID)) $this->ParentID = 0;
- $parentObj = DataObject::get_by_id($this->class, $this->ParentID);
- }
- // TODO Check that the $parentObj matches the ASSETS_PATH
- if(isset($parentObj->ID)) $path = $parentObj->FullPath . $this->Name;
- else $path = ASSETS_PATH . '/' . $this->Name;
-
- // Ensure uniqueness
- $i = 2;
- $basePath = $path . '-';
- while(file_exists($path)) {
- $path = $basePath . $i;
- $i++;
- }
-
- Filesystem::makeFolder($path);
-
- parent::onBeforeWrite();
- }
-
/**
* Find the given folder or create it both as {@link Folder} database records
* and on the filesystem. If necessary, creates parent folders as well.
Please sign in to comment.
Something went wrong with that request. Please try again.