BUG Files dataobjects with missing asset shouldn't un-attach themselves from parent object on save

This commit is contained in:
Damian Mooyman 2018-03-07 11:17:17 +13:00
parent 6ae07d100c
commit 5fee4a81aa
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -182,8 +182,9 @@ trait FileUploadReceiver
// Filter items by what's allowed to be viewed // Filter items by what's allowed to be viewed
$filteredItems = new ArrayList(); $filteredItems = new ArrayList();
$fileIDs = array(); $fileIDs = array();
/** @var File $file */
foreach ($items as $file) { foreach ($items as $file) {
if ($file->exists() && $file->canView()) { if ($file->isInDB() && $file->canView()) {
$filteredItems->push($file); $filteredItems->push($file);
$fileIDs[] = $file->ID; $fileIDs[] = $file->ID;
} }