Skip to content

Commit 5239bf9

Browse files
author
vnayda
committed
MAGETWO-56778: Value for multiple select attribute does not save
1 parent 85ea31c commit 5239bf9

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public function validate($object)
567567
*/
568568
public function load($object, $entityId, $attributes = [])
569569
{
570-
$this->loadAttributesMetadata($attributes, $object);
570+
$this->loadAttributesMetadata($attributes);
571571
$this->getEntityManager()->load($object, $entityId);
572572
return $this;
573573
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,13 +975,12 @@ public function load($object, $entityId, $attributes = [])
975975
* Loads attributes metadata.
976976
*
977977
* @param array|null $attributes
978-
* @param null|\Magento\Framework\DataObject $object
979978
* @return $this
980979
*/
981-
protected function loadAttributesMetadata($attributes, $object = null)
980+
protected function loadAttributesMetadata($attributes)
982981
{
983982
if (empty($attributes)) {
984-
$this->loadAllAttributes($object);
983+
$this->loadAllAttributes();
985984
} else {
986985
if (!is_array($attributes)) {
987986
$attributes = [$attributes];

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ public function getIdentities()
498498
*/
499499
public function __sleep()
500500
{
501+
$this->unsetData('attribute_set_info');
501502
return array_diff(
502503
parent::__sleep(),
503504
['_localeDate', '_localeResolver', 'reservedAttributeList', 'dateTimeFormatter']

lib/internal/Magento/Framework/EntityManager/Observer/AfterEntitySave.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public function execute(Observer $observer)
2727
{
2828
$entity = $observer->getEvent()->getEntity();
2929
if ($entity instanceof AbstractModel) {
30-
if (method_exists($entity->getResource(), 'loadAllAttributes')) {
31-
$entity->getResource()->loadAllAttributes($entity);
32-
}
3330
$entity->getResource()->afterSave($entity);
3431
$entity->afterSave();
3532
$entity->getResource()->addCommitCallback([$entity, 'afterCommitCallback']);

0 commit comments

Comments
 (0)