Bug 10808 - Thesaurus search form does not correspond to current search query
Summary: Thesaurus search form does not correspond to current search query
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 08:53 UTC by Fridolin Somers
Modified: 2015-06-04 23:23 UTC (History)
4 users (show)

See Also:
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 10808 - Thesaurus search form does not correspond to current search query (9.71 KB, patch)
2013-08-30 09:44 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 10808 - Formatting auth_finder.pl (9.95 KB, patch)
2013-08-30 09:46 UTC, Fridolin Somers
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10808 - Thesaurus search form does not correspond to current search query (9.97 KB, patch)
2013-09-20 00:43 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10808 - Formatting auth_finder.pl (10.02 KB, patch)
2013-09-20 00:43 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 10808 - Thesaurus search form does not correspond to current search query (10.09 KB, patch)
2013-09-23 06:21 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 10808 - Formatting auth_finder.pl (10.34 KB, patch)
2013-09-23 06:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2013-08-30 08:53:16 UTC
When cataloging a field defined with a thesaurus, an authority search popup is displayed with a search from. Once operators, values and sort selected in this form the search can be performed. The bug is that the values entered are kept but not the selected operators and sort.

The same bug was existing in authorities module, solved by Bug 8692.
Comment 1 Fridolin Somers 2013-08-30 09:44:17 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2013-08-30 09:46:08 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2013-09-20 00:43:07 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2013-09-20 00:43:19 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2013-09-23 06:21:33 UTC
Created attachment 21322 [details] [review]
[PASSED QA] Bug 10808 - Thesaurus search form does not correspond to current search query

When cataloging a field defined with a thesaurus, an authority search popup is displayed with a search from. Once operators, values and sort selected in this form the search can be performed. The bug is that the values entered are kept but not the selected operators and sort.
The same bug was existing in authorities module, solved by Bug 8692.

This patch corrects the bug.
Also uses in 'sort by' options the same text as search in authorities module : Heading A-Z (default), Heading Z-A, None.
Also removes duplicated code in auth_finder.pl : value_mainstr => $query->param('value_mainstr') || "", ...

Test plan :
- Create a new biblio with a framework containing a field linked to a thesaurus. For example : 600
- Click on small icon of main entry. For example : 600$a
=> You get a search form with all operators to "contains" and sort by "Heading A-Z"
- Enter a value in each text box and perform search
=> You get a search form with values in text boxes and all operators to "contains"
- Select "starts with" in all operator comboboxes and perform search
=> You get a search form with all operators to "starts with"
- Select "is exactly" in all operator comboboxes and perform search
=> You get a search form with all operators to "is exactly"
- Select "Heading Z-A" in sort by and perform search
=> You get a search form with "Heading Z-A" in sort by
- Select "None" in sort by and perform search
=> You get a search form with "None" in sort by

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: With both patches applied no koha-qa errors

Test
1) Original behavior is whatever selection you do before patch,
search form returns to default options
2) After patch, selection remains

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass, further comments on second patch.
Comment 6 Katrin Fischer 2013-09-23 06:24:06 UTC
Created attachment 21323 [details] [review]
[PASSED QA] Bug 10808 - Formatting auth_finder.pl

Perltidy and some format changes.
Most important : call to get_template_and_user must be at begining of script because it checks authentification.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes:
- Tested various searches, selections now remain after
  submitting the search form.
Regression testing:
- Clearing the authority from the record still works.
- Creating a new authority from the plugin page
  still works.
- Autocomplete of entries still works.
Comment 7 Galen Charlton 2013-10-18 04:48:06 UTC
Pushed to master.  Thanks, Jonathan!
Comment 8 Galen Charlton 2013-10-18 04:48:36 UTC
(In reply to Galen Charlton from comment #7)
> Pushed to master.  Thanks, Jonathan!

Actually, not yet -- sorry, wrong bug.
Comment 9 Galen Charlton 2013-12-10 04:34:28 UTC
Pushed to master.  Thanks, Fridolin!
Comment 10 Fridolin Somers 2013-12-24 10:07:23 UTC
Patches pushed to 3.14.x, will be in 3.14.2.
Comment 11 Tomás Cohen Arazi (tcohen) 2014-01-15 14:55:53 UTC
This patch has been pushed to 3.12.x, will be in 3.12.9.

Thanks Fridolin!