Forward advanced-search link state when query is empty (bootstrap theme)#3177
Merged
Merged
Conversation
…er (#3153) The /api/v2/ui/config endpoint consumed by the static themes built features.installation_link via SystemHelper#getHelpLink("installation"), which concatenates online.help.base.link + "installation-guide.html" and produced .../admin/installation-guide.html. The correct page is the online.help.installation template (.../install/install.html), as already resolved by the legacy JSP path. The same divergence affected eol_link ("eol" -> .../admin/eol-guide.html instead of .../eol.html). Centralize link resolution in SystemHelper#getInstallationLink() and #getEolLink() so the API and JSP paths share one implementation, and fix UiConfigHandler to use them. Claude-Session: https://claude.ai/code/session_017X3Vhm2U2pU7m12B8Q6JBw
…ut query updateAdvanceLinks() was resetting the advance link href to /search/advance when q was empty, discarding fields.label, lang, num, and sort. This caused label filters set from the search top page to not be carried over to the advanced search form.
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 the bootstrap theme so the "Advanced" search links keep the current view state even when there is no search query.
Previously,
updateAdvanceLinks()inthemes/bootstrap/assets/app.jsreturned early and reset every/search/advancelink to a bare/search/advancewheneverqwas empty. As a result, browsing by label (e.g.?fields.label=...with noq) and then clicking "Advanced" dropped the selected label, language, num, and sort state.Changes
updateAdvanceLinks().num,sort,lang, andfields.labelfrom the current URL onto the advanced-search links; includeqonly when present.?separator when no parameters are forwarded (link stays/search/advance).This aligns the SPA behavior with the classic JSP theme (
fe:pagingQuery(null)), which forwards state params regardless of whether a query is set. The consumer side (advance.jsprefillFromUrl()) already pre-seeds these fields independently ofq, so no consumer change is needed.Behavior
/search/advance/search/advance/search/advance(label lost)/search/advance?fields.label=...Test
Existing
BundledBootstrapThemeTest.test_appJs_advanceLinkForwardsPagingParamscontinues to pass (thenum/sort/lang/fields.labelforwarding assertions are unaffected).