ver. 0.323: fix import zdjęć, trwałe usuwanie produktów, fix API upload path
- IntegrationsRepository: refactor importu zdjęć — walidacja HTTP, curl timeouty, logi, czytelny komunikat - ProductRepository: saveCustomFields tylko gdy klucz istnieje (partial API update), delete() czyści custom_fields - ProductArchiveController: przycisk i metoda delete_permanent() do trwałego usunięcia z archiwum - ProductsApiController: fix ścieżki upload (api.php działa z rootu projektu) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1331,7 +1331,10 @@ class ProductRepository
|
||||
$this->saveImagesOrder( $productId, $d['gallery_order'] );
|
||||
}
|
||||
|
||||
$this->saveCustomFields( $productId, $d['custom_field_name'] ?? [], $d['custom_field_type'] ?? [], $d['custom_field_required'] ?? [] );
|
||||
// Zapisz custom fields tylko gdy jawnie podane (partial update przez API może nie zawierać tego klucza)
|
||||
if ( array_key_exists( 'custom_field_name', $d ) ) {
|
||||
$this->saveCustomFields( $productId, $d['custom_field_name'] ?? [], $d['custom_field_type'] ?? [], $d['custom_field_required'] ?? [] );
|
||||
}
|
||||
|
||||
if ( !$isNew ) {
|
||||
$this->cleanupDeletedFiles( $productId );
|
||||
@@ -1645,6 +1648,7 @@ class ProductRepository
|
||||
$this->db->delete( 'pp_shop_products_langs', [ 'product_id' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_products_images', [ 'product_id' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_products_files', [ 'product_id' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_products_custom_fields', [ 'id_product' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_products_attributes', [ 'product_id' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_products', [ 'id' => $productId ] );
|
||||
$this->db->delete( 'pp_shop_product_sets_products', [ 'product_id' => $productId ] );
|
||||
|
||||
Reference in New Issue
Block a user