Update actions_fetchobject.inc.php

This commit is contained in:
Laurent Destailleur 2023-09-11 10:48:49 +02:00 committed by GitHub
parent 6607f5f98e
commit 85aaac2fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@
if (($id > 0 || (!empty($ref) && !in_array($action, array('create', 'createtask', 'add')))) && (empty($cancel) || $id > 0)) {
if (($id > 0 && is_numeric($id)) || !empty($ref)) { // To discard case when id is list of ids like '1,2,3...'
if ($object->element == 'usergroup') {
$ret = $object->fetch($id, '', true); // to load $object->members
$ret = $object->fetch($id, (empty($ref)? '' : $ref), true); // to load $object->members
} else {
$ret = $object->fetch($id, (empty($ref)? '' : $ref));
}