From 426835781a68fedd05f06cb8a2a8bececcd4e7dc Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Wed, 18 Mar 2015 12:03:47 +0100
Subject: [PATCH] Fix hook usage

---
 htdocs/fourn/list.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php
index 4c16f3a1d61..2bf4b616414 100644
--- a/htdocs/fourn/list.php
+++ b/htdocs/fourn/list.php
@@ -104,7 +104,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.f
 foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key;
 // Add fields from hooks
 $parameters=array();
-$hookmanager->executeHooks('printFieldListSelect',$parameters);    // Note that $action and $object may have been modified by hook
+$result=$hookmanager->executeHooks('printFieldListSelect',$parameters);    // Note that $action and $object may have been modified by hook
 $sql.=$hookmanager->resPrint;
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid";
@@ -136,7 +136,8 @@ if ($search_categ > 0)   $sql.= " AND cf.fk_categorie = ".$search_categ;
 if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL";
 // Add where from hooks
 $parameters=array();
-$sql.=$hookmanager->executeHooks('printFieldListWhere',$parameters);    // Note that $action and $object may have been modified by hook
+$result=$hookmanager->executeHooks('printFieldListWhere',$parameters);    // Note that $action and $object may have been modified by hook
+$sql.=$hookmanager->resPrint;
 // Count total nb of records
 $nbtotalofrecords = 0;
 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
-- 
GitLab