GX-Bug #64429 » delete_products_performance_fix.patch
| src/admin/categories.php (date 1570034550004) | ||
|---|---|---|
| 491 | 491 |
} |
| 492 | 492 |
} |
| 493 | 493 |
} |
| 494 |
// convert multi_products_categories array to id collection |
|
| 495 |
$categoryIds = MainFactory::create('IdCollection', array_map(function($e) {
|
|
| 496 |
return new IdType($e); |
|
| 497 |
}, $products_categories[$product_id])); |
|
| 498 |
$coo_cache_control = MainFactory::create_object('CacheControl');
|
|
| 499 |
|
|
| 500 |
$productWriteService->unlinkProduct($productIdType, $categoryIds); |
|
| 501 |
$urlRewriteStorage->delete($productIdType); |
|
| 502 |
$coo_cache_control->reset_cache('all');
|
|
| 503 |
$sliderWriteService->deleteSliderAssignmentByProductId($productIdType); |
|
| 504 |
} |
|
| 494 |
|
|
| 495 |
if(isset($products_categories[$product_id])) {
|
|
| 496 |
// convert multi_products_categories array to id collection |
|
| 497 |
$categoryIds = MainFactory::create('IdCollection', array_map(function($e) {
|
|
| 498 |
return new IdType($e); |
|
| 499 |
}, $products_categories[$product_id])); |
|
| 500 |
|
|
| 501 |
$productWriteService->unlinkProduct($productIdType, $categoryIds); |
|
| 502 |
} |
|
| 503 |
|
|
| 504 |
$urlRewriteStorage->delete($productIdType); |
|
| 505 |
$sliderWriteService->deleteSliderAssignmentByProductId($productIdType); |
|
| 506 |
} |
|
| 507 |
|
|
| 508 |
$coo_cache_control = MainFactory::create_object('CacheControl');
|
|
| 509 |
$coo_cache_control->reset_cache('all');
|
|
| 505 | 510 |
} |
| 506 | 511 |
} |
| 507 | 512 |
// --- MULTI DELETE ENDS --- |