From d45ba5229dd5792cc1f55d83dfeb7d718a8f6af5 Mon Sep 17 00:00:00 2001 From: Alexandre Forestier Date: Wed, 27 May 2026 10:27:26 +0000 Subject: [PATCH] :bug: Skip empty result section when enable_enlarge is false Refs #919 When 'full_text_accelerators' is configured with 'enable_enlarge' => false for a class, the global search no longer renders the empty "0 result" section for that class. Without the Enlarge button, the section had no actionable content and only added visual clutter on instances configured with many such accelerators. Behavior is unchanged when 'enable_enlarge' is true, omitted, or the class has matching results. --- pages/ajax.render.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pages/ajax.render.php b/pages/ajax.render.php index 2bdf1cea69..734df57f62 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1423,12 +1423,19 @@ function(data){ } } else { if (array_key_exists($sClassName, $aAccelerators)) { - $oPage->add("
\n"); - $oPage->add("
\n"); - $oPage->add('

'.MetaModel::GetClassIcon($sClassName).Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', 0, Metamodel::GetName($sClassName)).$sEnlargeButton."

\n"); - $oPage->add("
\n"); - $oPage->add("
\n"); - $oPage->p(' '); // Some space ? + // Skip the empty result section when enlarge is disabled: + // the block has no actionable content (no Enlarge button) and only + // adds visual clutter on instances with many accelerators. + $bEnlargeEnabled = !array_key_exists('enable_enlarge', $aAccelerators[$sClassName]) + || $aAccelerators[$sClassName]['enable_enlarge'] !== false; + if ($bEnlargeEnabled) { + $oPage->add("
\n"); + $oPage->add("
\n"); + $oPage->add('

'.MetaModel::GetClassIcon($sClassName).Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', 0, Metamodel::GetName($sClassName)).$sEnlargeButton."

\n"); + $oPage->add("
\n"); + $oPage->add("
\n"); + $oPage->p(' '); // Some space ? + } } } if ($iTune > 0) {