Merge pull request #7914 from open-sausages/pulls/4.0/fix-deleted-files

BUG Files dataobjects with missing asset shouldn't un-attach themselves on save
This commit is contained in:
Chris Joe 2018-03-07 15:10:22 +13:00 committed by GitHub
commit f4caa5101f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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