Bug 20479: (follow-up) Don't try to get flags for database user
authorNick Clemens <nick@bywatersolutions.com>
Tue, 27 Mar 2018 15:05:57 +0000 (15:05 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Mar 2018 16:39:21 +0000 (13:39 -0300)
Login will still break in opac-user.pl, but that seems a bigger problem
not from SCI module

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Auth.pm

index 1b24c4f..e0cbbc5 100644 (file)
@@ -204,7 +204,7 @@ sub get_template_and_user {
                 $in->{template_name} =~ m|sco/| && haspermission(
                     $user, { self_check => 'self_checkout_module' }
                 )
-            ) && Koha::Patrons->find({userid=>$user})->flags != 1
+            ) && Koha::Patrons->find({userid=>$user}) && Koha::Patrons->find({userid=>$user})->flags != 1
           )
         {
             $kick_out = 1;