mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Fix root folder getFilename() returning incorrect path (#6510)
This commit is contained in:
parent
6bd7a6f00b
commit
d192a4f86f
@ -4,6 +4,7 @@ namespace SilverStripe\Assets;
|
||||
|
||||
use SilverStripe\Admin\AdminRootController;
|
||||
use SilverStripe\Admin\CMSPreviewable;
|
||||
use SilverStripe\Assets\Storage\AssetNameGenerator;
|
||||
use SilverStripe\Assets\Storage\DBFile;
|
||||
use SilverStripe\Assets\Storage\AssetContainer;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
|
@ -46,18 +46,6 @@ class Folder extends File
|
||||
return $this->isInDB();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function populateDefaults()
|
||||
{
|
||||
parent::populateDefaults();
|
||||
|
||||
if (!$this->Name) {
|
||||
$this->Name = _t('AssetAdmin.NEWFOLDER', "NewFolder");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the given folder or create it as a database record
|
||||
*
|
||||
|
@ -293,4 +293,10 @@ class FolderTest extends SapphireTest
|
||||
$this->assertEquals($newFolder->Name, $newFolder->Title);
|
||||
$this->assertEquals($newFolder->Title, 'TestTitleWithIllegalCharactersCopiedToName <!BANG!>');
|
||||
}
|
||||
|
||||
public function testRootFolder()
|
||||
{
|
||||
$root = Folder::singleton();
|
||||
$this->assertEquals('/', $root->getFilename());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user