Skip to content

Commit ca988aa

Browse files
committed
Merge remote-tracking branch 'origin/MC-37101' into 2.4-develop-pr39
2 parents f8c442e + 68bd351 commit ca988aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ protected function _isApplicableAttribute($object, $attribute)
626626
public function walkAttributes($partMethod, array $args = [], $collectExceptionMessages = null)
627627
{
628628
$methodArr = explode('/', $partMethod);
629+
$part = '';
630+
$method = '';
629631
switch (count($methodArr)) {
630632
case 1:
631633
$part = 'attribute';
@@ -642,6 +644,7 @@ public function walkAttributes($partMethod, array $args = [], $collectExceptionM
642644
}
643645
$results = [];
644646
$suffix = $this->getAttributesCacheSuffix($args[0]);
647+
$instance = null;
645648
foreach ($this->getAttributesByScope($suffix) as $attrCode => $attribute) {
646649
if (isset($args[0]) && is_object($args[0]) && !$this->_isApplicableAttribute($args[0], $attribute)) {
647650
continue;
@@ -1337,7 +1340,9 @@ protected function _collectSaveData($newObject)
13371340
if ($this->_canUpdateAttribute($attribute, $v, $origData)) {
13381341
if ($this->_isAttributeValueEmpty($attribute, $v)) {
13391342
$this->_aggregateDeleteData($delete, $attribute, $newObject);
1340-
} elseif (!is_numeric($v) && $v !== $origData[$k] || is_numeric($v) && $v != $origData[$k]) {
1343+
} elseif (!is_numeric($v) && $v !== $origData[$k]
1344+
|| is_numeric($v) && ($v != $origData[$k] || strlen($v) !== strlen($origData[$k]))
1345+
) {
13411346
$update[$attrId] = [
13421347
'value_id' => $attribute->getBackend()->getEntityValueId($newObject),
13431348
'value' => is_array($v) ? array_shift($v) : $v,//@TODO: MAGETWO-44182,
@@ -1739,6 +1744,7 @@ public function delete($object)
17391744
{
17401745
try {
17411746
$connection = $this->transactionManager->start($this->getConnection());
1747+
$id = 0;
17421748
if (is_numeric($object)) {
17431749
$id = (int) $object;
17441750
} elseif ($object instanceof \Magento\Framework\Model\AbstractModel) {

0 commit comments

Comments
 (0)