Skip to content

Commit c2a3ef6

Browse files
committed
MAGETWO-49618: [GitHub] Product Save & Duplicate Unexpected Behavior for Multiple Store Views #3426
- fix static
1 parent d949055 commit c2a3ef6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/code/Magento/Catalog/Plugin/Model/Attribute/Backend/AttributeValidation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AttributeValidation
1414

1515
/**
1616
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
17+
* @param array $allowedEntityTypes
1718
*/
1819
public function __construct(
1920
\Magento\Store\Model\StoreManagerInterface $storeManager,
@@ -34,7 +35,7 @@ public function aroundValidate(
3435
\Closure $proceed,
3536
\Magento\Framework\DataObject $entity
3637
) {
37-
$isAllowedType = !empty(array_filter(array_map(function($allowedEntity) use ($entity) {
38+
$isAllowedType = !empty(array_filter(array_map(function ($allowedEntity) use ($entity) {
3839
return $entity instanceof $allowedEntity;
3940
}, $this->allowedEntityTypes)));
4041

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/ValidateTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class ValidateTest extends \Magento\Catalog\Test\Unit\Controller\Adminhtml\Produ
4343
/** @var \Magento\Framework\Controller\Result\JsonFactory|\PHPUnit_Framework_MockObject_MockObject */
4444
protected $resultJsonFactory;
4545

46+
/**
47+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
48+
* @return void
49+
*/
4650
protected function setUp()
4751
{
4852
$this->productBuilder = $this->getMock(

app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ protected function getAttributes($entityType)
9999
* @throws \Magento\Framework\Exception\ConfigurationMismatchException
100100
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
101101
* @SuppressWarnings(PHPMD.NPathComplexity)
102+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
102103
*/
103104
public function execute($entityType, $entityData, $arguments = [])
104105
{
@@ -121,7 +122,8 @@ public function execute($entityType, $entityData, $arguments = [])
121122
/**
122123
* Only scalar values can be stored in generic tables
123124
*/
124-
if (isset($entityData[$attribute->getAttributeCode()]) && !is_scalar($entityData[$attribute->getAttributeCode()])) {
125+
if (isset($entityData[$attribute->getAttributeCode()])
126+
&& !is_scalar($entityData[$attribute->getAttributeCode()])) {
125127
continue;
126128
}
127129
if (isset($snapshot[$attribute->getAttributeCode()])

0 commit comments

Comments
 (0)