1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 08:17:12 +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:
Ryan Cramer
2017-01-20 09:49:19 -05:00
parent a434f6193d
commit 07dbc4e6f6

View File

@@ -517,7 +517,12 @@ class FieldtypeFile extends FieldtypeMulti {
if($pagefiles = $page->get($field->name)) { 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(); $pagefiles->deleteAll();
} else if($pagefiles instanceof Pagefile) { } else if($pagefiles instanceof Pagefile) {