mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Allow disabling of File::updateFilesystem() which is useful
for manually managing the filesystem paths instead. Defaults to on, but useful to turn off when loading File records in a YAML fixture for test data.
This commit is contained in:
parent
f8d38a332c
commit
7f60ced66b
@ -149,6 +149,7 @@ class File extends DataObject {
|
|||||||
*/
|
*/
|
||||||
public static $apply_restrictions_to_admin = true;
|
public static $apply_restrictions_to_admin = true;
|
||||||
|
|
||||||
|
public static $update_filesystem = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached result of a "SHOW FIELDS" call
|
* Cached result of a "SHOW FIELDS" call
|
||||||
@ -476,6 +477,8 @@ class File extends DataObject {
|
|||||||
* (it might have been influenced by {@link setName()} or {@link setParentID()} before).
|
* (it might have been influenced by {@link setName()} or {@link setParentID()} before).
|
||||||
*/
|
*/
|
||||||
public function updateFilesystem() {
|
public function updateFilesystem() {
|
||||||
|
if(!self::$update_filesystem) return false;
|
||||||
|
|
||||||
// Regenerate "Filename", just to be sure
|
// Regenerate "Filename", just to be sure
|
||||||
$this->setField('Filename', $this->getRelativePath());
|
$this->setField('Filename', $this->getRelativePath());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user