Bugzilla – Attachment 155550 Details for
Bug 34760
Prevent error when logging into OPAC after conducting a search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34760: Confirm session ID is set to save OPAC search history to logged in user
Bug-34760-Confirm-session-ID-is-set-to-save-OPAC-s.patch (text/plain), 3.30 KB, created by
Salah Ghedda
on 2023-09-12 14:09:43 UTC
(
hide
)
Description:
Bug 34760: Confirm session ID is set to save OPAC search history to logged in user
Filename:
MIME Type:
Creator:
Salah Ghedda
Created:
2023-09-12 14:09:43 UTC
Size:
3.30 KB
patch
obsolete
>From 20af37aa48f9ab42de6e0bd2bccbeb6fccb06904 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 11 Sep 2023 20:47:34 +0000 >Subject: [PATCH] Bug 34760: Confirm session ID is set to save OPAC search > history to logged in user > >This patch confirms that a session ID has been set before trying to save search history to a logged in user on the OPAC. > >This depends on EnableOpacSearchHistory system preference being enabled. > >Apply the patch and test that you don't see an Error 500 page at any point through this plan: > >1. Do an OPAC search, ensure you are not logged in >2. Confirm your search was saved to search history >3. Do another search, then log in >4. Confirm you are brought back to the search results after logging in >5. Confirm all search history from the session is visible > >Sponsored-by: Toi Ohomai Institute of Technology >Signed-off-by: Salah Ghedda <salah.ghedda@inLibro.com> >--- > opac/opac-search.pl | 37 +++++++++++++++++++++---------------- > 1 file changed, 21 insertions(+), 16 deletions(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 0d940e5717..febfc107e5 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -717,24 +717,29 @@ for (my $i=0;$i<@servers;$i++) { > $query_cgi_history =~ s/;/&/g; > my $query_desc_history = join ", ", grep { defined $_ } $query_desc, $limit_desc; > >- unless ( $borrowernumber ) { >- my $new_searches = C4::Search::History::add_to_session({ >- cgi => $cgi, >+ if ( $borrowernumber and $cgi->cookie("CGISESSID") ) { >+ >+ # To the session (the user is logged in) >+ C4::Search::History::add( >+ { >+ userid => $borrowernumber, >+ sessionid => $cgi->cookie("CGISESSID"), > query_desc => $query_desc_history, >- query_cgi => $query_cgi_history, >- total => $total, >- type => "biblio", >- }); >+ query_cgi => $query_cgi_history, >+ total => $total, >+ type => "biblio", >+ } >+ ); > } else { >- # To the session (the user is logged in) >- C4::Search::History::add({ >- userid => $borrowernumber, >- sessionid => $cgi->cookie("CGISESSID"), >- query_desc => $query_desc_history, >- query_cgi => $query_cgi_history, >- total => $total, >- type => "biblio", >- }); >+ my $new_searches = C4::Search::History::add_to_session( >+ { >+ cgi => $cgi, >+ query_desc => $query_desc_history, >+ query_cgi => $query_cgi_history, >+ total => $total, >+ type => "biblio", >+ } >+ ); > } > } > $template->param( EnableOpacSearchHistory => 1 ); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34760
:
155521
|
155550
|
155762