diff --git a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php index c71225b4fc6..20a38a1c0af 100644 --- a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php +++ b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php @@ -87,7 +87,7 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity { $applyTo = $attribute->getApplyTo() ?: []; return (count($applyTo) == 0 || in_array($object->getTypeId(), $applyTo)) - && $attribute->isInSet($object->getAttributeSetId()); + && $attribute->isInSet($object->getAttributeSetId() ?? $this->getEntityType()->getDefaultAttributeSetId()); } /** diff --git a/vendor/magento/module-eav/Model/Entity/AbstractEntity.php b/vendor/magento/module-eav/Model/Entity/AbstractEntity.php index 08823bacce4..58d27fcff16 100644 --- a/vendor/magento/module-eav/Model/Entity/AbstractEntity.php +++ b/vendor/magento/module-eav/Model/Entity/AbstractEntity.php @@ -549,7 +549,16 @@ abstract class AbstractEntity extends AbstractResource implements EntityInterfac */ public function loadAllAttributes($object = null) { - return $this->attributeLoader->loadAllAttributes($this, $object); + $result = $this->attributeLoader->loadAllAttributes($this, $object); + if ($object instanceof DataObject && $object->getAttributeSetId()) { + $suffix = $this->getAttributesCacheSuffix($object); + $this->_attrSetEntity->addSetInfo( + $this->getEntityType(), + $this->getAttributesByScope($suffix), + $object->getAttributeSetId() + ); + } + return $result; } /**