This commit is contained in:
Clément 2025-04-24 15:37:30 +02:00 committed by GitHub
parent ea59ab8837
commit 585577d667
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1490,7 +1490,7 @@ class Expedition extends CommonObject
// Add a protection to refuse deleting if shipment has at least one delivery
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
if (count($this->linkedObjectsIds) > 0) {
if (isset($this->linkedObjectsIds['delivery']) && count($this->linkedObjectsIds['delivery']) > 0) {
$this->error = 'ErrorThereIsSomeDeliveries';
$error++;
}
@ -1700,7 +1700,7 @@ class Expedition extends CommonObject
// Add a protection to refuse deleting if shipment has at least one delivery
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
if (count($this->linkedObjectsIds) > 0) {
if (isset($this->linkedObjectsIds['delivery']) && count($this->linkedObjectsIds['delivery']) > 0) {
$this->error = 'ErrorThereIsSomeDeliveries';
$error++;
}