From b0835b1dc88edf431613341d1d0c9eab36e7c0c0 Mon Sep 17 00:00:00 2001 From: Nathan <130627685+nathanpixodeo@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:42:58 +0700 Subject: [PATCH] fix: keep full product label searchable in combo (#39057) --- htdocs/core/class/html.form.class.php | 36 ++++++++------ test/phpunit/FormTest.php | 72 +++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 525e6e1bbd0..56d0a3d69e7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4042,10 +4042,11 @@ class Form $maxlengtharticle = getDolGlobalInt('PRODUCT_MAX_LENGTH_COMBO', 48); - $label = $objp->label; + $productlabel = $objp->label; if (!empty($objp->label_translated)) { - $label = $objp->label_translated; + $productlabel = $objp->label_translated; } + $label = $productlabel; if (!empty($filterkey) && $filterkey != '') { $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '$1', $label, 1); } @@ -4121,18 +4122,19 @@ class Form } } - // Set $labeltoshow - $labeltoshow = ''; - $labeltoshow .= $objp->ref; + // Set full plain label for the native