Bug 19048 - Self checkout: Internal server error in sco-main.pl
Summary: Self checkout: Internal server error in sco-main.pl
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi
URL:
Whiteboard:
Keywords:
Depends on: 17829
Blocks: 12691
  Show dependency treegraph
 
Reported: 2017-08-07 09:40 UTC by Marc Véron
Modified: 2017-09-12 13:45 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout (2.14 KB, patch)
2017-08-07 12:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 19048: (bug 17829 follow-up) Fix regression in self checkout (2.20 KB, patch)
2017-08-07 13:35 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout (2.27 KB, patch)
2017-08-07 13:41 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout (2.24 KB, patch)
2017-08-07 13:50 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-08-07 09:40:10 UTC
Internal server error in sco-main.pl:

Can't call method "unblessed" on an undefined value at (...)/koha/opac/sco/sco-main.pl line 117

To reproduce: Call SCO main page

Line 117 is:
my $borrower = Koha::Patrons->find( { cardnumber => $patronid } )->unblessed;

The error occurs if $patronid does not exist in the database. This is already the case with the first call of sco-main.pl ($patronid is '').
Comment 1 Marc Véron 2017-08-07 10:12:50 UTC
Seems to be introduced by:
Bug 17829 - Move GetMember to Koha::Patron
Comment 2 Jonathan Druart 2017-08-07 12:58:34 UTC
Created attachment 65537 [details] [review]
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout

$patronid is not necessarily set or does not match a valid cardnumber.
These cases must be taken into account to avoid the script to crash and
raise the following error:
Can't call method "unblessed" on an undefined value at
(...)/koha/opac/sco/sco-main.pl line 117

Test plan:
Hit sco/sco-main.pl and confirm that the error is gone with this patch
applied
Comment 3 Owen Leonard 2017-08-07 13:35:42 UTC
Created attachment 65547 [details] [review]
[SIGNED-OFF] Bug 19048: (bug 17829 follow-up) Fix regression in self checkout

$patronid is not necessarily set or does not match a valid cardnumber.
These cases must be taken into account to avoid the script to crash and
raise the following error:
Can't call method "unblessed" on an undefined value at
(...)/koha/opac/sco/sco-main.pl line 117

Test plan:
Hit sco/sco-main.pl and confirm that the error is gone with this patch
applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Marc Véron 2017-08-07 13:41:16 UTC
Created attachment 65550 [details] [review]
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout

$patronid is not necessarily set or does not match a valid cardnumber.
These cases must be taken into account to avoid the script to crash and
raise the following error:
Can't call method "unblessed" on an undefined value at
(...)/koha/opac/sco/sco-main.pl line 117

Test plan:
Hit sco/sco-main.pl and confirm that the error is gone with this patch
applied

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 5 Marc Véron 2017-08-07 13:42:13 UTC
Comment on attachment 65550 [details] [review]
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout

Owen was faster...
Comment 6 Tomás Cohen Arazi 2017-08-07 13:50:14 UTC
Created attachment 65553 [details] [review]
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout

$patronid is not necessarily set or does not match a valid cardnumber.
These cases must be taken into account to avoid the script to crash and
raise the following error:
Can't call method "unblessed" on an undefined value at
(...)/koha/opac/sco/sco-main.pl line 117

Test plan:
Hit sco/sco-main.pl and confirm that the error is gone with this patch
applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Jonathan Druart 2017-08-08 12:46:36 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin SOMERS 2017-09-12 13:45:13 UTC
Depends on Bug 17829 not in 17.05.x