Skip to content

Commit 548789b

Browse files
committed
ACP2E-2595: Custom Customer Attribute Not Saving File type Attribute(Image)
1 parent c333d32 commit 548789b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/code/Magento/Customer/Controller/Account/EditPost.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Customer\Model\AuthenticationInterface;
1717
use Magento\Customer\Model\Customer\Mapper;
1818
use Magento\Customer\Model\EmailNotificationInterface;
19+
use Magento\Customer\Model\Metadata\Form\File;
1920
use Magento\Framework\App\CsrfAwareActionInterface;
2021
use Magento\Framework\App\ObjectManager;
2122
use Magento\Framework\App\Request\InvalidRequestException;
@@ -234,8 +235,11 @@ public function execute()
234235
$customerCandidate = $this->populateNewCustomerDataObject($this->_request, $customer);
235236

236237
$attributeToDelete = $this->_request->getParam('delete_attribute_value');
237-
if ($attributeToDelete !== null) {
238-
$this->deleteCustomerFileAttribute($customerCandidate, $attributeToDelete);
238+
if ((string)$attributeToDelete !== "") {
239+
$uploadedValue = $this->_request->getParam($attributeToDelete . File::UPLOADED_FILE_SUFFIX);
240+
if ((string)$uploadedValue === "") {
241+
$this->deleteCustomerFileAttribute($customerCandidate, $attributeToDelete);
242+
}
239243
}
240244

241245
try {

0 commit comments

Comments
 (0)