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)
320
320
}
321
321
322
322
// 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
+ ) {
324
327
$ this ->fileProcessor ->removeUploadedFile ($ this ->_value );
325
328
return $ value ;
326
329
}
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ public function testCompactValueNoDelete()
393
393
->with ('value ' )
394
394
->willReturnSelf ();
395
395
396
- $ this ->assertSame (' value ' , $ model ->compactValue ([]));
396
+ $ this ->assertSame ([] , $ model ->compactValue ([]));
397
397
}
398
398
399
399
public function testCompactValueDelete ()
@@ -625,7 +625,7 @@ public function testCompactValueRemoveUiComponentValue()
625
625
->with ($ value )
626
626
->willReturnSelf ();
627
627
628
- $ this ->assertEquals ($ value , $ model ->compactValue ([]));
628
+ $ this ->assertEquals ([] , $ model ->compactValue ([]));
629
629
}
630
630
631
631
public function testCompactValueNoAction ()
You can’t perform that action at this time.
0 commit comments