From fa295499761e16d53b4efb2d9d7c0439518860fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 03:09:31 +0200 Subject: [PATCH] Fix trans --- htdocs/core/customreports.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 613b0c59556..54ca4043a05 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -288,9 +288,17 @@ if (is_array($search_groupby) && count($search_groupby)) { if (count($arrayofvaluesforgroupby['g_'.$gkey]) > $MAXUNIQUEVALFORGROUP) { $langs->load("errors"); + if (strpos($fieldtocount, 'te.') === 0) { + //if (!empty($extrafields->attributes[$object->table_element]['langfile'][$gvalwithoutprefix])) { + // $langs->load($extrafields->attributes[$object->table_element]['langfile'][$gvalwithoutprefix]); + //} + $keyforlabeloffield = $extrafields->attributes[$object->table_element]['label'][$gvalwithoutprefix]; + } else { + $keyforlabeloffield = $object->fields[$gvalwithoutprefix]['label']; + } //var_dump($gkey.' '.$gval.' '.$gvalwithoutprefix); $gvalwithoutprefix = preg_replace('/\-(year|month|day)/', '', $gvalwithoutprefix); - $labeloffield = $langs->transnoentitiesnoconv($object->fields[$gvalwithoutprefix]['label']); + $labeloffield = $langs->transnoentitiesnoconv($keyforlabeloffield); setEventMessages($langs->trans("ErrorTooManyDifferentValueForSelectedGroupBy", $MAXUNIQUEVALFORGROUP, $labeloffield), null, 'warnings'); $search_groupby = array(); }