diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index adcfb408166..7c8a78cf8ce 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -375,10 +375,11 @@ if (! $search_all) $sql.= " state.code_departement, state.nom,"; $sql.= ' country.code,'; $sql.= " p.rowid, p.ref, p.title"; - - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) //prevent error with sql_mode=only_full_group_by - { - $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key : ''); + if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + //prevent error with sql_mode=only_full_group_by + $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key : ''); + } } } else