If AutoSelfCheckID is an not valid ( either by deleting the patron or by changing the patron's userid ), self-checkout will display the login screen and no error will be generated in any logs.
Created attachment 154469 [details] [review] Bug 34545: Koha should die with an error if AutoSelfCheckID is invalid If AutoSelfCheckID is an not valid ( either by deleting the patron or by changing the patron's userid ), self-checkout will display the login screen and no error will be generated in any logs. Test Plan: 1) Apply this patch 2) Verify AutoSelfCheckID is working as expected 3) Change AutoSelfCheckID to an invalid userid 4) Restart all the things! 5) Verify visiting sco-main.pl generates an error!
Created attachment 154473 [details] [review] Bug 34545: Koha should die with an error if AutoSelfCheckID is invalid If AutoSelfCheckID is an not valid ( either by deleting the patron or by changing the patron's userid ), self-checkout will display the login screen and no error will be generated in any logs. Test Plan: 1) Apply this patch 2) Verify AutoSelfCheckID is working as expected 3) Change AutoSelfCheckID to an invalid userid 4) Restart all the things! 5) Verify visiting sco-main.pl generates an error! Signed-off-by: David Cook <dcook@prosentient.com.au>
I'm signing off on this one, since it works as described. However, I'm not sure about the approach. I think adding a warning in the logs is a very good idea, but generating an internal server error seems suboptimal. It might be better to generate a more graceful error message on the screen. That said, an ISE is probably better than what we have at the moment. Failing early and noisy would get the situation fixed ASAP I suspect.
Since this is just two lines, we should be able to meet: PERL26: Koha::Exceptions (Approved on Apr 26, 2017) Instead of die or croak when meeting unfavorable conditions in our code, we should raise exceptions via Koha::Exceptions.