mirror of
https://github.com/processwire/processwire.git
synced 2025-08-08 15:57:01 +02:00
Fix issue #161 where deleted page using default file/image fallback could delete fallback file if deleting page without outputFormatting enabled.
This commit is contained in:
@@ -517,7 +517,12 @@ class FieldtypeFile extends FieldtypeMulti {
|
||||
|
||||
if($pagefiles = $page->get($field->name)) {
|
||||
|
||||
if($pagefiles instanceof Pagefiles) {
|
||||
$dvpID = $field->get('defaultValuePage');
|
||||
|
||||
if($dvpID && $dvpID != $page->id && $pagefiles->page->id != $page->id) {
|
||||
// pagefiles is a default/fallback value from another page and should not be deleted
|
||||
|
||||
} else if($pagefiles instanceof Pagefiles) {
|
||||
$pagefiles->deleteAll();
|
||||
|
||||
} else if($pagefiles instanceof Pagefile) {
|
||||
|
Reference in New Issue
Block a user