FIX #18544 Shipment REST API: load thirdparty object into the shipment before validating.
This commit is contained in:
parent
eecbfc0ad4
commit
0fce409155
@ -716,7 +716,9 @@ class Orders extends DolibarrApi
|
|||||||
if (!$result) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Order not found');
|
throw new RestException(404, 'Order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result = $this->commande->fetch_thirdparty(); // do not check result, as failure is not fatal (used only for mail notification substitutes)
|
||||||
|
|
||||||
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
@ -729,13 +731,6 @@ class Orders extends DolibarrApi
|
|||||||
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
|
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
|
||||||
}
|
}
|
||||||
$result = $this->commande->fetch($id);
|
$result = $this->commande->fetch($id);
|
||||||
if (!$result) {
|
|
||||||
throw new RestException(404, 'Order not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->commande->fetchObjectLinked();
|
$this->commande->fetchObjectLinked();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user