@@ -626,6 +626,8 @@ protected function _isApplicableAttribute($object, $attribute)
626
626
public function walkAttributes ($ partMethod , array $ args = [], $ collectExceptionMessages = null )
627
627
{
628
628
$ methodArr = explode ('/ ' , $ partMethod );
629
+ $ part = '' ;
630
+ $ method = '' ;
629
631
switch (count ($ methodArr )) {
630
632
case 1 :
631
633
$ part = 'attribute ' ;
@@ -642,6 +644,7 @@ public function walkAttributes($partMethod, array $args = [], $collectExceptionM
642
644
}
643
645
$ results = [];
644
646
$ suffix = $ this ->getAttributesCacheSuffix ($ args [0 ]);
647
+ $ instance = null ;
645
648
foreach ($ this ->getAttributesByScope ($ suffix ) as $ attrCode => $ attribute ) {
646
649
if (isset ($ args [0 ]) && is_object ($ args [0 ]) && !$ this ->_isApplicableAttribute ($ args [0 ], $ attribute )) {
647
650
continue ;
@@ -1337,7 +1340,9 @@ protected function _collectSaveData($newObject)
1337
1340
if ($ this ->_canUpdateAttribute ($ attribute , $ v , $ origData )) {
1338
1341
if ($ this ->_isAttributeValueEmpty ($ attribute , $ v )) {
1339
1342
$ 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
+ ) {
1341
1346
$ update [$ attrId ] = [
1342
1347
'value_id ' => $ attribute ->getBackend ()->getEntityValueId ($ newObject ),
1343
1348
'value ' => is_array ($ v ) ? array_shift ($ v ) : $ v ,//@TODO: MAGETWO-44182,
@@ -1739,6 +1744,7 @@ public function delete($object)
1739
1744
{
1740
1745
try {
1741
1746
$ connection = $ this ->transactionManager ->start ($ this ->getConnection ());
1747
+ $ id = 0 ;
1742
1748
if (is_numeric ($ object )) {
1743
1749
$ id = (int ) $ object ;
1744
1750
} elseif ($ object instanceof \Magento \Framework \Model \AbstractModel) {
0 commit comments