Skip to content

Commit 8062310

Browse files
committed
MAGETWO-69862: Error on the medium profile during repeated generation
1 parent dfdbd9c commit 8062310

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ class ConfigurableProductsFixture extends Fixture
151151
private $swatchesGenerator;
152152

153153
/**
154-
* ConfigurableProductsFixture constructor.
154+
* @var \Magento\Framework\Serialize\SerializerInterface
155+
*/
156+
private $serializer;
157+
158+
/**
155159
* @param FixtureModel $fixtureModel
156160
* @param AttributeSet\AttributeSetFixture $attributeSetsFixture
157161
* @param AttributeSet\Pattern $attributePattern
@@ -163,7 +167,8 @@ class ConfigurableProductsFixture extends Fixture
163167
* @param CategoryResolver $categoryResolver
164168
* @param WebsiteCategoryProvider $websiteCategoryProvider
165169
* @param PriceProvider $priceProvider
166-
* @param \Magento\Setup\Fixtures\AttributeSet\SwatchesGenerator $swatchesGenerator
170+
* @param AttributeSet\SwatchesGenerator $swatchesGenerator
171+
* @param \Magento\Framework\Serialize\SerializerInterface $serializer
167172
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
168173
*/
169174
public function __construct(
@@ -178,7 +183,8 @@ public function __construct(
178183
CategoryResolver $categoryResolver,
179184
WebsiteCategoryProvider $websiteCategoryProvider,
180185
PriceProvider $priceProvider,
181-
\Magento\Setup\Fixtures\AttributeSet\SwatchesGenerator $swatchesGenerator
186+
\Magento\Setup\Fixtures\AttributeSet\SwatchesGenerator $swatchesGenerator,
187+
\Magento\Framework\Serialize\SerializerInterface $serializer
182188
) {
183189
parent::__construct($fixtureModel);
184190
$this->attributeSetsFixture = $attributeSetsFixture;
@@ -192,6 +198,7 @@ public function __construct(
192198
$this->websiteCategoryProvider = $websiteCategoryProvider;
193199
$this->priceProvider = $priceProvider;
194200
$this->swatchesGenerator = $swatchesGenerator;
201+
$this->serializer = $serializer;
195202
}
196203

197204
/**
@@ -638,7 +645,7 @@ private function getConfigurableSkuPattern($config, $attributeSetName)
638645
*/
639646
private function getCustomAttributeSet(array $attributes)
640647
{
641-
$attributeSetHash = md5(json_encode($attributes));
648+
$attributeSetHash = crc32($this->serializer->serialize($attributes));
642649
$attributeSetName = sprintf('Dynamic Attribute Set %s', $attributeSetHash);
643650

644651
$pattern = $this->attributePattern->generateAttributeSet(

0 commit comments

Comments
 (0)