Bug 40968 - 'Edit this search' forgets about 'whole_records' and 'weighted_fields'
Summary: 'Edit this search' forgets about 'whole_records' and 'weighted_fields'
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 40966
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-07 17:32 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-10-07 18:36 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40968: Make 'Edit this search' aware of 'whole_records' and 'weighted_fields' (4.01 KB, patch)
2025-10-07 18:36 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2025-10-07 17:32:11 UTC
Found it while playing with links on bug 40966.

To reproduce:
1. Apply bug 40966
2. Perform an adv search as in that bug. Using the 'More options' tab.
3. Include any of the following options (or both):
   * Search entire MARC record
   * Apply field weights to search
4. Notice the facets include 'whole_records=1' and/or 'weighted_fields=1' (this is the bug 40966 patch in action)
5. hover the 'Edit this search' link
=> SUCCESS: It gets the query parameters passed through
6. Click on the link
=> FAIL: None is really set, we lost search information.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-10-07 18:36:47 UTC
Created attachment 187544 [details] [review]
Bug 40968: Make 'Edit this search' aware of 'whole_records' and 'weighted_fields'

This patch makes the advanced search page that gets pre-filled with
previous searches (a.k.a 'Edit this search') behave like this:

* 'More options' is preselected if any of 'whole_records' or
  'weighted_fields' query parameters are passed
* In Edit-mode, the checkboxes for those are pre-filled with the passed
  values
* In normal mode, the current behavior is preserved to avoid changing
  it.

To test:
1. Apply bug 40966
2. Perform an adv search as in that bug. Using the 'More options' tab.
3. Include any of the following options (or both):
   * Search entire MARC record
   * Apply field weights to search
4. Notice the facets include 'whole_records=1' and/or 'weighted_fields=1' (this is the bug 40966 patch in action)
5. hover the 'Edit this search' link
=> SUCCESS: It gets the query parameters passed through
6. Click on the link
=> FAIL: None is really set, we lost search information.
7. Go back to the search results
8. Apply this patch
9. Refresh the page
10. Click on the 'Edit this search' link
=> SUCCESS: The page is pre-loaded with the right values for 'Search
entire MARC record' and 'Apply field weights to search'
11. Sign off :-D