@@ -562,9 +562,11 @@ |
||
562 | 562 | |
563 | 563 | $map = $this->getMappedChunk( $list, $mapping ); |
564 | 564 | |
565 | - if( isset( $map[0] ) ) // there can only be one chunk for the base product data |
|
565 | + if( isset( $map[0] ) ) { |
|
566 | + // there can only be one chunk for the base product data |
|
566 | 567 | { |
567 | 568 | $type = $this->checkType( $this->getValue( $map[0], 'product.type', $product->getType() ) ); |
569 | + } |
|
568 | 570 | $map[0]['product.config'] = json_decode( $map[0]['product.config'] ?? '[]', true ) ?: []; |
569 | 571 | |
570 | 572 | $product = $product->fromArray( $map[0], true ); |
@@ -592,8 +592,7 @@ |
||
592 | 592 | { |
593 | 593 | $manager->move( $item->getId(), $item->getParentId(), $parentid ); |
594 | 594 | $item = $manager->save( $item ); |
595 | - } |
|
596 | - else |
|
595 | + } else |
|
597 | 596 | { |
598 | 597 | $item = $manager->insert( $item, $parentid ); |
599 | 598 | } |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | foreach( $manager->search( $search ) as $item ) { |
85 | 85 | $this->listTypes[$item->getCode()] = $item->getCode(); |
86 | 86 | } |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | $this->listTypes = array_flip( $this->listTypes ); |
91 | 90 | } |
@@ -155,8 +154,7 @@ discard block |
||
155 | 154 | $listItem = $listMap[$url][$type][$langId][$listtype]; |
156 | 155 | $refItem = $listItem->getRefItem(); |
157 | 156 | unset( $listItems[$listItem->getId()] ); |
158 | - } |
|
159 | - else |
|
157 | + } else |
|
160 | 158 | { |
161 | 159 | $listItem = $listManager->create()->setType( $listtype ); |
162 | 160 | $refItem = $manager->create()->setType( $type ); |
@@ -120,9 +120,12 @@ |
||
120 | 120 | |
121 | 121 | foreach( $items as $item ) |
122 | 122 | { |
123 | - try { |
|
123 | + try |
|
124 | + { |
|
124 | 125 | $manager->save( $cntl->scale( $item, 'fs-media', $force ) ); |
125 | - } catch( \Exception $e ) { |
|
126 | + } |
|
127 | + catch( \Exception $e ) |
|
128 | + { |
|
126 | 129 | $msg = sprintf( 'Scaling media item "%1$s" failed: %2$s', $item->getId(), $e->getMessage() ); |
127 | 130 | $logger->log( $msg, Log::ERR, 'media/scale' ); |
128 | 131 | } |