From fa18e788b5698bdcf7d168cd2ad79d72187beeb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Sep 2017 17:29:00 +0200 Subject: [PATCH] Fix must use photo of user --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- htdocs/core/class/html.formactions.class.php | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) 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 '';