Fix bug reported by scrutinizers

This commit is contained in:
Laurent Destailleur 2017-12-02 15:03:14 +01:00
parent e57c8f324d
commit 1f4a079f01
2 changed files with 3 additions and 1 deletions

View File

@ -2959,6 +2959,8 @@ class Propal extends CommonObject
*/
function demand_reason($demand_reason_id, $notrigger=0)
{
global $user;
if ($this->statut >= self::STATUS_DRAFT)
{
$error=0;

View File

@ -1098,7 +1098,7 @@ if (empty($reshook))
$exp = new Expedition($db);
$exp->fetch($object->origin_id);
$exp->fetchObjectLinked();
if (count($exp->linkedObjectsIds['commande']) > 0) {
if (is_array($exp->linkedObjectsIds['commande']) && count($exp->linkedObjectsIds['commande']) > 0) {
foreach ($exp->linkedObjectsIds['commande'] as $key => $value){
$object->linked_objects['commande'] = $value;
}