[Bug 40968] New: 'Edit this search' forgets about 'whole_records' and 'weighted_fields'
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Bug ID: 40968 Summary: 'Edit this search' forgets about 'whole_records' and 'weighted_fields' Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org 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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |40966 CC| |tomascohen@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40966 [Bug 40966] 'whole_record' and 'weighted_fields' not passed around -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 187544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187544&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188008 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188008&action=edit 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 (as weighted_fields is on by default, we rely on a new parameter to achieve this) * 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 Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- 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 (as weighted_fields is on by default, we rely on a new parameter to achieve this) * 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 Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187544|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Patch doesn't apply --- Comment #4 from David Nind <david@davidnind.com> --- Getting sha1/fake ancestor error when applying the patch: Bug 40968: Make 'Edit this search' aware of 'whole_records' and 'weighted_fields' Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 40968: Make 'Edit this search' aware of 'whole_records' and 'weighted_fields' error: sha1 information is lacking or useless (koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt). error: could not build fake ancestor Patch failed at 0001 Bug 40968: Make 'Edit this search' aware of 'whole_records' and 'weighted_fields' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188008|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40968 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198905 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198905&action=edit Bug 40968: Pass weight_search to template in advsearch path The 'Edit this search' link correctly passes weight_search and whole_record parameters in the URL (thanks to bug 40966), but the advanced search form doesn't pre-fill the 'Apply field weights' checkbox because weight_search is not passed to the template in the advsearch exit path. The template logic checks: [% IF weight_search_submitted && !weight_search %] to uncheck the box, but weight_search was never set, so the checkbox always appeared unchecked when editing a search. This patch passes weight_search from the CGI params to the template in both catalogue/search.pl and opac/opac-search.pl. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org