Skip to content

Commit 64aa902

Browse files
author
Stanislav Idolov
authored
ENGCOM-937: [Backport 2.1] MAGETWO-71697: Fix possible bug when saving address with empty street line #14115
2 parents 92325c4 + 9a2db2c commit 64aa902

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function setData($key, $value = null)
263263
{
264264
if (is_array($key)) {
265265
$key = $this->_implodeArrayField($key);
266-
} elseif (is_array($value) && !empty($value) && $this->isAddressMultilineAttribute($key)) {
266+
} elseif (is_array($value) && $this->isAddressMultilineAttribute($key)) {
267267
$value = $this->_implodeArrayValues($value);
268268
}
269269
return parent::setData($key, $value);
@@ -303,7 +303,11 @@ protected function _implodeArrayField(array $data)
303303
*/
304304
protected function _implodeArrayValues($value)
305305
{
306-
if (is_array($value) && count($value)) {
306+
if (is_array($value)) {
307+
if (!count($value)) {
308+
return '';
309+
}
310+
307311
$isScalar = false;
308312
foreach ($value as $val) {
309313
if (is_scalar($val)) {

0 commit comments

Comments
 (0)