@@ -181,7 +181,8 @@ |
||
181 | 181 | $data = $this->object()->process( $product, $data ); |
182 | 182 | |
183 | 183 | $manager->commit(); |
184 | - } catch( \Exception $e ) |
|
184 | + } |
|
185 | + catch( \Exception $e ) |
|
185 | 186 | { |
186 | 187 | $manager->rollback(); |
187 | 188 | throw $e; |
@@ -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, $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 | } |
@@ -564,9 +564,11 @@ |
||
564 | 564 | |
565 | 565 | $map = $this->getMappedChunk( $list, $mapping ); |
566 | 566 | |
567 | - if( isset( $map[0] ) ) // there can only be one chunk for the base product data |
|
567 | + if( isset( $map[0] ) ) { |
|
568 | + // there can only be one chunk for the base product data |
|
568 | 569 | { |
569 | 570 | $type = $this->checkType( $this->val( $map[0], 'product.type', $product->getType() ) ); |
571 | + } |
|
570 | 572 | $map[0]['product.config'] = json_decode( $map[0]['product.config'] ?? '[]', true ) ?: []; |
571 | 573 | |
572 | 574 | $product = $product->fromArray( $map[0], true ); |
@@ -97,8 +97,7 @@ discard block |
||
97 | 97 | $files[] = $entry->getPathname(); |
98 | 98 | } |
99 | 99 | } |
100 | - } |
|
101 | - else |
|
100 | + } else |
|
102 | 101 | { |
103 | 102 | $files[] = $location; |
104 | 103 | } |
@@ -240,7 +239,9 @@ discard block |
||
240 | 239 | |
241 | 240 | return $currentid; |
242 | 241 | } |
243 | - catch( \Aimeos\MShop\Exception $e ) {} // not found, create new |
|
242 | + catch( \Aimeos\MShop\Exception $e ) |
|
243 | + { |
|
244 | +} // not found, create new |
|
244 | 245 | } |
245 | 246 | |
246 | 247 | $item = $this->process( $manager->create(), $node ); |
@@ -278,13 +279,11 @@ discard block |
||
278 | 279 | |
279 | 280 | $currentid = $this->importNode( $node, $domains, $parentid, $childMap ); |
280 | 281 | $total++; |
281 | - } |
|
282 | - elseif( $xml->nodeType === \XMLReader::ELEMENT && $xml->name === 'catalog' ) |
|
282 | + } elseif( $xml->nodeType === \XMLReader::ELEMENT && $xml->name === 'catalog' ) |
|
283 | 283 | { |
284 | 284 | $this->importTree( $xml, $domains, $currentid, $childMap ); |
285 | 285 | $childMap = []; |
286 | - } |
|
287 | - elseif( $xml->nodeType === \XMLReader::END_ELEMENT && $xml->name === 'catalog' ) |
|
286 | + } elseif( $xml->nodeType === \XMLReader::END_ELEMENT && $xml->name === 'catalog' ) |
|
288 | 287 | { |
289 | 288 | \Aimeos\MShop::create( $this->context(), 'catalog' )->delete( $map ); |
290 | 289 | break; |