File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
app/code/Magento/Customer
Test/Unit/Model/Metadata/Form Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -320,7 +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 ' ])) {
323+ if (!empty ($ this ->_value )
324+ && (!empty ($ value ['delete ' ])
325+ || ($ this ->_entityTypeCode == 'customer ' && empty ($ value )))
326+ ) {
324327 $ this ->fileProcessor ->removeUploadedFile ($ this ->_value );
325328 return $ value ;
326329 }
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ public function testCompactValueNoDelete()
393393 ->with ('value ' )
394394 ->willReturnSelf ();
395395
396- $ this ->assertSame (' value ' , $ model ->compactValue ([]));
396+ $ this ->assertSame ([] , $ model ->compactValue ([]));
397397 }
398398
399399 public function testCompactValueDelete ()
@@ -625,7 +625,7 @@ public function testCompactValueRemoveUiComponentValue()
625625 ->with ($ value )
626626 ->willReturnSelf ();
627627
628- $ this ->assertEquals ($ value , $ model ->compactValue ([]));
628+ $ this ->assertEquals ([] , $ model ->compactValue ([]));
629629 }
630630
631631 public function testCompactValueNoAction ()
You can’t perform that action at this time.
0 commit comments