@@ -301,12 +301,9 @@ protected function convertCustomAttributeValue($customAttributesValueArray, $dat
301
301
{
302
302
$ result = [];
303
303
$ dataObjectClassName = ltrim ($ dataObjectClassName , '\\' );
304
- $ attributesPreprocessorMap = $ this ->getAttributesPreprocessorsMap ();
305
304
306
305
foreach ($ customAttributesValueArray as $ key => $ customAttribute ) {
307
- if ($ key && is_array ($ customAttribute ) && array_key_exists ($ key , $ attributesPreprocessorMap )) {
308
- $ this ->runCustomAttributePreprocessors ($ key , $ customAttribute , $ attributesPreprocessorMap [$ key ]);
309
- }
306
+ $ this ->runCustomAttributePreprocessors ($ key , $ customAttribute );
310
307
if (!is_array ($ customAttribute )) {
311
308
$ customAttribute = [AttributeValue::ATTRIBUTE_CODE => $ key , AttributeValue::VALUE => $ customAttribute ];
312
309
}
@@ -370,13 +367,16 @@ private function getAttributesPreprocessorsMap()
370
367
*
371
368
* @param string $key
372
369
* @param mixed $customAttribute
373
- * @return bool
374
370
*/
375
- private function runCustomAttributePreprocessors ($ key , &$ customAttribute, $ preprocessorlsList )
371
+ private function runCustomAttributePreprocessors ($ key , &$ customAttribute )
376
372
{
377
- foreach ($ preprocessorlsList as $ attributePreprocessor ) {
378
- if ($ attributePreprocessor ->shouldBeProcessed ($ key , $ customAttribute )) {
379
- $ attributePreprocessor ->process ($ key , $ customAttribute );
373
+ $ preprocessorsMap = $ this ->getAttributesPreprocessorsMap ();
374
+ if ($ key && is_array ($ customAttribute ) && array_key_exists ($ key , $ preprocessorsMap )) {
375
+ $ preprocessorsList = $ preprocessorsMap [$ key ];
376
+ foreach ($ preprocessorsList as $ attributePreprocessor ) {
377
+ if ($ attributePreprocessor ->shouldBeProcessed ($ key , $ customAttribute )) {
378
+ $ attributePreprocessor ->process ($ key , $ customAttribute );
379
+ }
380
380
}
381
381
}
382
382
}
0 commit comments