Skip to content
Snippets Groups Projects
Commit d9a38333 authored by Robert He's avatar Robert He Committed by GitHub
Browse files

Merge pull request #390 from magento-jackalopes/MAGETWO-56063-upgrade-from-2.0.7-to-2.1.0

[Jackalopes] MAGETWO-56063 upgrade from 2.0.7 to 2.1.0 (2.2 release)
parents 2842e92f d46494bb
No related merge requests found
...@@ -13,6 +13,7 @@ use Magento\Framework\Model\Entity\ScopeResolver; ...@@ -13,6 +13,7 @@ use Magento\Framework\Model\Entity\ScopeResolver;
use Magento\Framework\Model\Entity\ScopeInterface; use Magento\Framework\Model\Entity\ScopeInterface;
use Magento\Framework\EntityManager\Operation\AttributeInterface; use Magento\Framework\EntityManager\Operation\AttributeInterface;
use Magento\Eav\Model\Entity\AttributeCache; use Magento\Eav\Model\Entity\AttributeCache;
use Psr\Log\LoggerInterface;
/** /**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
...@@ -49,6 +50,11 @@ class ReadHandler implements AttributeInterface ...@@ -49,6 +50,11 @@ class ReadHandler implements AttributeInterface
*/ */
protected $scopeResolver; protected $scopeResolver;
/**
* @var LoggerInterface
*/
private $logger;
/** /**
* ReadHandler constructor. * ReadHandler constructor.
* *
...@@ -58,6 +64,7 @@ class ReadHandler implements AttributeInterface ...@@ -58,6 +64,7 @@ class ReadHandler implements AttributeInterface
* @param AppResource $appResource * @param AppResource $appResource
* @param ScopeResolver $scopeResolver * @param ScopeResolver $scopeResolver
* @param AttributeCache $attributeCache * @param AttributeCache $attributeCache
* @param LoggerInterface $logger
*/ */
public function __construct( public function __construct(
AttributeRepository $attributeRepository, AttributeRepository $attributeRepository,
...@@ -65,7 +72,8 @@ class ReadHandler implements AttributeInterface ...@@ -65,7 +72,8 @@ class ReadHandler implements AttributeInterface
SearchCriteriaBuilder $searchCriteriaBuilder, SearchCriteriaBuilder $searchCriteriaBuilder,
AppResource $appResource, AppResource $appResource,
ScopeResolver $scopeResolver, ScopeResolver $scopeResolver,
AttributeCache $attributeCache AttributeCache $attributeCache,
LoggerInterface $logger
) { ) {
$this->attributeRepository = $attributeRepository; $this->attributeRepository = $attributeRepository;
$this->metadataPool = $metadataPool; $this->metadataPool = $metadataPool;
...@@ -73,6 +81,7 @@ class ReadHandler implements AttributeInterface ...@@ -73,6 +81,7 @@ class ReadHandler implements AttributeInterface
$this->appResource = $appResource; $this->appResource = $appResource;
$this->scopeResolver = $scopeResolver; $this->scopeResolver = $scopeResolver;
$this->attributeCache = $attributeCache; $this->attributeCache = $attributeCache;
$this->logger = $logger;
} }
/** /**
...@@ -163,7 +172,14 @@ class ReadHandler implements AttributeInterface ...@@ -163,7 +172,14 @@ class ReadHandler implements AttributeInterface
\Magento\Framework\DB\Select::SQL_UNION_ALL \Magento\Framework\DB\Select::SQL_UNION_ALL
); );
foreach ($connection->fetchAll($unionSelect) as $attributeValue) { foreach ($connection->fetchAll($unionSelect) as $attributeValue) {
$entityData[$attributesMap[$attributeValue['attribute_id']]] = $attributeValue['value']; if (isset($attributesMap[$attributeValue['attribute_id']])) {
$entityData[$attributesMap[$attributeValue['attribute_id']]] = $attributeValue['value'];
} else {
$this->logger->warning(
"Attempt to load value of nonexistent EAV attribute '{$attributeValue['attribute_id']}'
for entity type '$entityType'."
);
}
} }
} }
return $entityData; return $entityData;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment