🐛 Skip empty result section when accelerator has enable_enlarge=false#920
Open
AlxFrst wants to merge 1 commit into
Open
🐛 Skip empty result section when accelerator has enable_enlarge=false#920AlxFrst wants to merge 1 commit into
AlxFrst wants to merge 1 commit into
Conversation
Refs Combodo#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.
Hipska
reviewed
May 27, 2026
Contributor
Hipska
left a comment
There was a problem hiding this comment.
Wouldn't this have been cleaner to add?
if (array_key_exists($sClassName, $aAccelerators)
&& (!array_key_exists('enable_enlarge', $aAccelerators[$sClassName])
|| $aAccelerators[$sClassName]['enable_enlarge'] !== false)) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #919.
When
full_text_acceleratorsis configured withenable_enlarge => falsefor a class, the global search still rendered an empty "0 result" section for that class. The block contained no actionable content (no Enlarge button, by configuration) and only added visual clutter, especially on instances with several accelerators configured this way.This PR aligns the rendering with the existing
enable_enlargesemantic: when the action is explicitly disabled, the empty section is no longer rendered.Cause
In
pages/ajax.render.php(~ line 1424), the empty result block was rendered for every accelerated class regardless of theenable_enlargevalue. The flag only governed whether the button was shown inside the header, not whether the section itself should appear when there was no match.Fix
Wrap the empty-section rendering in a check for
enable_enlarge !== false. The check defaults toenabledwhen the key is absent, preserving the current behavior for any configuration that doesn't opt into the new behavior.Compatibility
enable_enlargetruefalseStrictly opt-in via existing configuration. Only impacts configurations that explicitly set
enable_enlarge => false, where the current behavior was arguably a bug.Test plan
enable_enlarge => false, search with no match → empty section no longer appearsenable_enlarge => true(or omitted), search with no match → empty section still appears with the Enlarge button