diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 4d1f0d571e1..cb6da443404 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -851,7 +851,8 @@ class ActionComm extends CommonObject } /** - * Load all objects with filters + * Load all objects with filters. + * WARNING: This make a fetch on all records instead of making one request with a join. * * @param DoliDb $db Database handler * @param int $socid Filter by thirdparty diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 579520f7647..f09dab9be38 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -250,12 +250,10 @@ class FormActions } print ''; print ''; - if (! empty($action->author->id)) + if (! empty($action->userownerid)) { - $userstatic->id = $action->author->id; - $userstatic->firstname = $action->author->firstname; - $userstatic->lastname = $action->author->lastname; - print $userstatic->getNomUrl(1, '', 0, 0, 16, 0, '', ''); + $userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched + print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', ''); } print ''; print '';