mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
commit
f4caa5101f
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user