On current master, if you do not have a session and try to visit a detail view page you will get an error: Can't use an undefined value as a HASH reference at /home/magnus/scripts/kohadev/opac/opac-detail.pl line 445. The offending line looks like this: my $branch = C4::Context->userenv->{branch}; This will typically happen if you follow a direct link to a detail view in an OPAC you have not visited before, or not visited in such a long time that the session expired. If you get the error, visit the front page and go back to the detail view that gave the error it will work, because visiting the front page establishes a new session: <rangi> you dont have a userenv <rangi> if you arent logged in <magnuse> that makes sense :-) <magnuse> but... do you get one by visiting the front page, then? <rangi> yep <rangi> starts an anonymous session <magnuse> and that only happens on the front page? <rangi> or search results <rangi> doesnt happen on detail page <rangi> and it shouldnt <rangi> cos else google would spawn a zillion sessions Huge thanks to Chris C. who suggested the fix for this, but did not want to submit a patch for it. :-) The problem was caused by Bug 7740. There was a similar problem in opac-serach.pl, fixed on Bug 9980.
Created attachment 18017 [details] [review] Bug 10217 - Make sure direct links to detail views work when there is no session To reproduce: - Make sure you do not have a session for the OPAC you will be testing with. Delete the CGISESSID session cookie if you have one. - Go directly to a detail view, e.g.: /cgi-bin/koha/opac-detail.pl?biblionumber=1 - Observe the error "Can't use an undefined value as a HASH reference at /home/magnus/scripts/kohadev/opac/opac-detail.pl line 445." To test: - Apply the patch - Reload the page with the error - You should now see the detail view of the record, as usual Thanks to Chris Cormack who suggested the fix for this!
Created attachment 18037 [details] [review] [SIGNED-OFF] Bug 10217 - Make sure direct links to detail views work when there is no session To reproduce: - Make sure you do not have a session for the OPAC you will be testing with. Delete the CGISESSID session cookie if you have one. - Go directly to a detail view, e.g.: /cgi-bin/koha/opac-detail.pl?biblionumber=1 - Observe the error "Can't use an undefined value as a HASH reference at /home/magnus/scripts/kohadev/opac/opac-detail.pl line 445." To test: - Apply the patch - Reload the page with the error - You should now see the detail view of the record, as usual Thanks to Chris Cormack who suggested the fix for this! Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 18085 [details] [review] [PASSED QA] Bug 10217 - Make sure direct links to detail views work when there is no session To reproduce: - Make sure you do not have a session for the OPAC you will be testing with. Delete the CGISESSID session cookie if you have one. - Go directly to a detail view, e.g.: /cgi-bin/koha/opac-detail.pl?biblionumber=1 - Observe the error "Can't use an undefined value as a HASH reference at /home/magnus/scripts/kohadev/opac/opac-detail.pl line 445." To test: - Apply the patch - Reload the page with the error - You should now see the detail view of the record, as usual Thanks to Chris Cormack who suggested the fix for this! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested according to test plan, confirmed patch fixes the problem. All tests and QA script pass.
This patch has been pushed to master and 3.12.x.
*** Bug 10175 has been marked as a duplicate of this bug. ***
Not needed for 3.10.x or below