diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1a5eadfbde7..01ce37ee3a8 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -74,7 +74,7 @@ $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('member'); +$extralabels = $extrafields->fetch_name_optionals_label('adherent'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // List of fields to search into when doing a "search in all" @@ -156,6 +156,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $catid=""; $sall=""; $statut=''; + $search_array_options=array(); } @@ -185,6 +186,7 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";