From a025628c9724efcffedd259a7e3f69290efa5065 Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Mon, 19 Jan 2026 20:36:37 +0100 Subject: [PATCH] FIX concatenation of labels in extrafields (#36888) IF: - The extrafield is of type "Select from list" - AND it would use a join as table - AND the label would be a concatenation of fields from both tables THEN, the EF value could not be displayed (showOutputField os showInputField). example of syntax that would trigger this error : `commande c INNER JOIN llx_societe s ON s.rowid = c.fk_soc:s.nom|c.ref:c.rowid::` This commit fixes this. --- htdocs/core/class/extrafields.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index df34c949cef..cde58f0cfee 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1622,6 +1622,7 @@ class ExtraFields if (is_array($fields_label) && count($fields_label) > 1) { $notrans = true; foreach ($fields_label as $field_toshow) { + $field_toshow = preg_replace('/^.*\./', '', $field_toshow); $labeltoshow .= $obj->$field_toshow.' '; } } else { @@ -2216,6 +2217,7 @@ class ExtraFields if (is_array($fields_label) && count($fields_label) > 1) { foreach ($fields_label as $field_toshow) { $translabel = ''; + $field_toshow = preg_replace('/^.*\./', '', $field_toshow); if (!empty($obj->$field_toshow)) { $translabel = $outputlangs->trans($obj->$field_toshow);