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 '').
Seems to be introduced by: Bug 17829 - Move GetMember to Koha::Patron
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
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>
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 on attachment 65550 [details] [review] Bug 19048: (bug 17829 follow-up) Fix regression in self checkout Owen was faster...
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>
Pushed to master for 17.11, thanks to everybody involved!
Depends on Bug 17829 not in 17.05.x