Bug 28112 - Z39.50 does not populate form with all passed criteria
Summary: Z39.50 does not populate form with all passed criteria
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 1277
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-07 16:26 UTC by Owen Leonard
Modified: 2021-12-13 21:10 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 28112: Z39.50 does not populate form with all passed criteria (9.10 KB, patch)
2021-04-07 17:41 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28112: Z39.50 does not populate form with all passed criteria (9.15 KB, patch)
2021-04-07 21:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 28112: Z39.50 does not populate form with all passed criteria (9.21 KB, patch)
2021-04-14 12:15 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-04-07 16:26:35 UTC
Bug 1277 added options to the Z39.50 search form but didn't take into account that search terms for those new fields might be passed in the URL. For example, a URL containing all possible fields:

/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

...should bring up a form which has values in every field. Instead, these fields are empty:


Subject heading
Keyword (any)
LC call number
Control no.
Dewey
Standard ID
Comment 1 Owen Leonard 2021-04-07 17:41:49 UTC
Created attachment 119309 [details] [review]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
Comment 2 David Nind 2021-04-07 21:05:00 UTC
Created attachment 119316 [details] [review]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2021-04-14 12:14:42 UTC
The "try another search" button will put you back on the prefilled form if you are using acqui/z3950_search. However cataloguing/z3950_search will display a blank form.
Can be considered outside of the scope here.
Comment 4 Jonathan Druart 2021-04-14 12:15:16 UTC
Created attachment 119567 [details] [review]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2021-04-14 13:36:40 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-04-19 12:52:34 UTC
Pushed to 20.11.x for 20.11.05
Comment 7 Andrew Fuerste-Henry 2021-04-25 15:06:50 UTC
Pushed to 20.05.x for 20.05.11
Comment 8 Victor Grousset/tuxayo 2021-04-25 17:25:27 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.