From 2048eaa0e9c64d88d516f55812e98762e658093d Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Wed, 12 Jun 2019 11:43:48 +0000
Subject: [PATCH] Bug 23102: 404 errors on page causes SCI user to be logged
 out

To test:
 1 - Have something on the SCO page that won't load
 2 - Add the self_checkin_module and self_checkout_module permissions to the AutoSelfCheck user
 3 - Access the selfcheckout module https://yoursite.org/cgi-bin/koha/sco/sco-main.pl
 4 - Sign in
 5 - Click 'Finish'
 6 - Yes to print a receipt
 7 - You are asked to sign in again
 8 - Repeat with the SCI module
 9 - Apply patch
10 - Repeat, but this time the slip can be printed
---
 C4/Auth.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index adc1b5dd0d..9fd23b61a3 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -235,7 +235,7 @@ sub get_template_and_user {
 # If the user logged in is the SCI user and they try to go out of the SCI module,
 # kick them out unless it is SCO with a valid permission
 # or they are a superlibrarian
-               $in->{template_name} !~ m|sci/|
+            $in->{template_name} !~ m|sci/| && $in->{template_name} !~ m|errors/errorpage.tt|
             && haspermission( $user, { self_check => 'self_checkin_module' } )
             && !(
                 $in->{template_name} =~ m|sco/| && haspermission(
-- 
2.30.2