Bug 16198 - Opac suggestions are broken if user is not logged in
Summary: Opac suggestions are broken if user is not logged in
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 15629
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-04 21:10 UTC by Katrin Fischer
Modified: 2019-06-27 09:24 UTC (History)
3 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:
Circulation function:


Attachments
Bug 16198: Fix regression in OPAC suggestions (1.61 KB, patch)
2016-04-05 07:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16198: Fix regression in OPAC suggestions (1.73 KB, patch)
2016-04-05 11:07 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 16198: Fix regression in OPAC suggestions (1.78 KB, patch)
2016-04-05 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-04-04 21:10:20 UTC
/cgi-bin/koha/opac-suggestions.pl reached from the OPAC navigation will show a Perl error when the user is not logged into the OPAC:

http://localhost/cgi-bin/koha/opac-suggestions.pl
Comment 1 Katrin Fischer 2016-04-04 21:10:50 UTC
Copy and paste mistake, the error is:

Can't call method "branchname" on an undefined value at /home/katrin/kohaclone/opac/opac-suggestions.pl line 153.
Comment 2 Jonathan Druart 2016-04-05 07:40:49 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2016-04-05 11:07:11 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2016-04-05 21:51:47 UTC
Created attachment 49933 [details] [review]
[PASSED QA] Bug 16198: Fix regression in OPAC suggestions

Introduced by
  commit d564d3732d95455b4626dfa8ca711cd658003c17
  Bug 15629: Koha::Libraries - Remove GetBranchInfo

If the branchcodesuggestedby is not defined, the find won't return
anything and ->branchname on an undefined value will raise
  Can't call method "branchname" on an undefined value at
  /home/katrin/kohaclone/opac/opac-suggestions.pl line 153.

Test plan:
-Staff
Create a patron
Use this patron to create a suggestion
Delete the patron

-OPAC
Logout and trigger opac/opac-suggestions.pl

Without this patch, you will get an error
With this patch applied, everything should be ok

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works ok following test plan
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Brendan Gallagher 2016-04-06 22:06:22 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 6 Julian Maurice 2016-04-07 05:16:52 UTC
Not needed in stable versions, status changed to RESOLVED