Koha/koha-tmpl/opac-tmpl/bootstrap/js/authtoresults.js
Lee Jamison fa25c45ffc Bug 17153: Redirect to search when logging in from search
This patch is a fresh attempt at redirecting back to search
results after logging in on opac-search.pl

To test:
- Perform an OPAC search
- Login on opac-search.pl with the search results displayed
- The page is redirected to opac-user.pl
- Log out
- Apply the patch
- Perform a new OPAC search
- Note the URL query string
- Login on opac-search.pl with the search results displayed
- The opac-search.pl page should be displayed with the correct
  query string and the page should indicate a logged in status

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-06-29 20:49:51 +00:00

10 lines
No EOL
355 B
JavaScript

if (window.location.href.indexOf("opac-search.pl") > -1) {
// extract search params
var searchUrl = location.href;
var searchParams = searchUrl.substring(searchUrl.indexOf("?")+1);
// store search params in loginModal to pass back on redirect
var query = document.getElementById("has-search-query");
query.value = searchParams;
}