Summary: | Opening bibliographic record page prepopulates search bar text | ||
---|---|---|---|
Product: | Koha | Reporter: | Elaina Komala <ekomala> |
Component: | Searching | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | arthur.suzuki, caroline.cyr-la-rose, jonathan.druart, lucas, nick, sally.healey, victor |
Version: | Main | ||
Hardware: | PC | ||
OS: | Windows | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31967 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.01, 21.11.07
|
|
Circulation function: | |||
Bug Depends on: | 23475 | ||
Bug Blocks: | |||
Attachments: |
Bug 27697: Only preopulate search when we have found a single biblio
Bug 27697: Only preopulate search when we have found a single biblio Bug 27697: Only preopulate search when we have found a single biblio |
Description
Elaina Komala
2021-02-12 17:47:32 UTC
It has been added by bug 23475. Nick, maybe we should use sessionStorage instead of localStorage? Nick, this is very confusing IMO. We should invalidate/reset the value at some point. It's not consistent to have the input prefilled if we are coming from another view than the result view. Created attachment 135146 [details] [review] Bug 27697: Only preopulate search when we have found a single biblio This patch uses the url parameter we created in 23475 to determine whether we should populate the search bar or not Note - a bookmark with this param will still populate search term with last search To test: 1 - Search staff client for 'cat' 2 - Browse to a patrons checkouts and click on a title, or just go directly to a details page: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850 3 - Search bar says 'cat' 4 - Apply patch 5 - Repeat 1-2 6 - Search bar is not populated 7 - Search "dalek war box set" or a term that finds a single record in your instance 8 - Search bar is populated 9 - Note url like: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850&found1=1 (In reply to Jonathan Druart from comment #3) > Ha, it's bug 26247. > > *** This bug has been marked as a duplicate of bug 26247 *** I unduplicated - that seems more about copying between boxes - this is about populating when we shouldn't Created attachment 135457 [details] [review] Bug 27697: Only preopulate search when we have found a single biblio This patch uses the url parameter we created in 23475 to determine whether we should populate the search bar or not Note - a bookmark with this param will still populate search term with last search To test: 1 - Search staff client for 'cat' 2 - Browse to a patrons checkouts and click on a title, or just go directly to a details page: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850 3 - Search bar says 'cat' 4 - Apply patch 5 - Repeat 1-2 6 - Search bar is not populated 7 - Search "dalek war box set" or a term that finds a single record in your instance 8 - Search bar is populated 9 - Note url like: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850&found1=1 Signed-off-by: David Nind <david@davidnind.com> Created attachment 135468 [details] [review] Bug 27697: Only preopulate search when we have found a single biblio This patch uses the url parameter we created in 23475 to determine whether we should populate the search bar or not Note - a bookmark with this param will still populate search term with last search To test: 1 - Search staff client for 'cat' 2 - Browse to a patrons checkouts and click on a title, or just go directly to a details page: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850 3 - Search bar says 'cat' 4 - Apply patch 5 - Repeat 1-2 6 - Search bar is not populated 7 - Search "dalek war box set" or a term that finds a single record in your instance 8 - Search bar is populated 9 - Note url like: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850&found1=1 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 22.11. Nice work everyone, thanks! Pushed to 22.05.x for 22.05.01 This adds a new warning in the log [2022/06/16 10:31:18] [WARN] CGI::param called in list context from /kohadevbox/koha/catalogue/detail.pl line 626, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 414. It should be $template->param(found1 => scalar $query->param('found1') ); (In reply to Jonathan Druart from comment #10) > This adds a new warning in the log > > [2022/06/16 10:31:18] [WARN] CGI::param called in list context from > /kohadevbox/koha/catalogue/detail.pl line 626, this can lead to > vulnerabilities. See the warning in "Fetching the value or values of a > single named parameter" at /usr/share/perl5/CGI.pm line 414. > > It should be > > $template->param(found1 => scalar $query->param('found1') ); See bug 30997. thx pushed to 21.11.x for 21.11.07 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. This seems like a bug fix rather than a feature. Not sure what documentation is needed. Closing, but feel free to reopen with details. |