Skip to content

Commit 593df0f

Browse files
author
mastiuhin-olexandr
committed
MC-41351: Cannot remove data using attribute with "File" type in admin area
1 parent 5309c6b commit 593df0f

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Customer/Model/Metadata/Form

1 file changed

+4
-4
lines changed

app/code/Magento/Customer/Model/Metadata/Form/File.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ public function compactValue($value)
320320
}
321321

322322
// Remove outdated file (in the case of file uploader UI component)
323-
if (!empty($this->_value) && !empty($value['delete'])) {
324-
$this->fileProcessor->removeUploadedFile($this->_value);
325-
return $value;
326-
} else if ($this->_entityTypeCode == 'customer' && empty($value) && !empty($this->_value)) {
323+
if (!empty($this->_value)
324+
&& (!empty($value['delete'])
325+
|| ($this->_entityTypeCode == 'customer' && empty($value)))
326+
) {
327327
$this->fileProcessor->removeUploadedFile($this->_value);
328328
return $value;
329329
}

0 commit comments

Comments
 (0)