Skip to content

Commit 65ff6cd

Browse files
authored
ENGCOM-4213: [Backport] Number of Lines in a Street Address not setting to default when you checked Use system value #20566
2 parents 18f226f + a0fc09c commit 65ff6cd

File tree

1 file changed

+13
-8
lines changed
  • app/code/Magento/Customer/Model/Config/Backend/Address

1 file changed

+13
-8
lines changed

app/code/Magento/Customer/Model/Config/Backend/Address/Street.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,20 @@ public function afterDelete()
8787
{
8888
$result = parent::afterDelete();
8989

90-
if ($this->getScope() == \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES) {
91-
$attribute = $this->_eavConfig->getAttribute('customer_address', 'street');
92-
$website = $this->_storeManager->getWebsite($this->getScopeCode());
93-
$attribute->setWebsite($website);
94-
$attribute->load($attribute->getId());
95-
$attribute->setData('scope_multiline_count', null);
96-
$attribute->save();
97-
}
90+
$attribute = $this->_eavConfig->getAttribute('customer_address', 'street');
91+
switch ($this->getScope()) {
92+
case \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES:
93+
$website = $this->_storeManager->getWebsite($this->getScopeCode());
94+
$attribute->setWebsite($website);
95+
$attribute->load($attribute->getId());
96+
$attribute->setData('scope_multiline_count', null);
97+
break;
9898

99+
case ScopeConfigInterface::SCOPE_TYPE_DEFAULT:
100+
$attribute->setData('multiline_count', 2);
101+
break;
102+
}
103+
$attribute->save();
99104
return $result;
100105
}
101106
}

0 commit comments

Comments
 (0)