diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index b97a7ea8c30..a98b5f1c157 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -730,7 +730,7 @@ class Reception extends CommonObject if (!empty($this->origin) && $this->origin_id > 0 && ($this->origin == 'order_supplier' || $this->origin == 'commandeFournisseur')) { if (empty($this->origin_object)) { $this->fetch_origin(); - if (empty($this->origin_object->lines)) { + if ($this->origin_object instanceof CommonObject && empty($this->origin_object->lines)) { $res = $this->origin_object->fetch_lines(); if ($this->origin_object instanceof CommandeFournisseur) { $this->commandeFournisseur = $this->origin_object; // deprecated diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index d6372cfb6a6..6fda1372180 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,7 +93,7 @@ $hookmanager->initHooks(array('usercard', 'userperms', 'globalcard')); * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -193,6 +194,8 @@ foreach ($modulesdir as $dir) { $db->commit(); +'@phan-var-force DolibarrModules[] $modules'; + // Read permissions of edited user $permsuser = array(); @@ -323,7 +326,7 @@ if (!empty($object->socid)) { print info_admin(showModulesExludedForExternal($modules))."\n"; } -$parameters = array('permsgroupbyentity'=>$permsgroupbyentity); +$parameters = array('permsgroupbyentity' => $permsgroupbyentity); $reshook = $hookmanager->executeHooks('insertExtraHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');