diff --git a/C4/Auth.pm b/C4/Auth.pm index 8d0ea60725..0f85d3cd9e 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -130,7 +130,7 @@ sub get_template_and_user { # We are going to use the $flags returned by checkauth # to create the template's parameters that will indicate # which menus the user can access. - if ($flags->{superlibrarian} == 1) + if ($flags && $flags->{superlibrarian} == 1) { $template->param(CAN_user_circulate => 1); $template->param(CAN_user_catalogue => 1); @@ -146,53 +146,53 @@ sub get_template_and_user { $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{circulate} == 1) { + if ($flags && $flags->{circulate} == 1) { $template->param(CAN_user_circulate => 1); } - if ($flags->{catalogue} == 1) { + if ($flags && $flags->{catalogue} == 1) { $template->param(CAN_user_catalogue => 1); } - if ($flags->{parameters} == 1) { + if ($flags && $flags->{parameters} == 1) { $template->param(CAN_user_parameters => 1); $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{borrowers} == 1) { + if ($flags && $flags->{borrowers} == 1) { $template->param(CAN_user_borrowers => 1); } - if ($flags->{permissions} == 1) { + if ($flags && $flags->{permissions} == 1) { $template->param(CAN_user_permission => 1); } - if ($flags->{reserveforothers} == 1) { + if ($flags && $flags->{reserveforothers} == 1) { $template->param(CAN_user_reserveforothers => 1); } - if ($flags->{borrow} == 1) { + if ($flags && $flags->{borrow} == 1) { $template->param(CAN_user_borrow => 1); } - if ($flags->{reserveforself} == 1) { + if ($flags && $flags->{reserveforself} == 1) { $template->param(CAN_user_reserveforself => 1); } - if ($flags->{editcatalogue} == 1) { + if ($flags && $flags->{editcatalogue} == 1) { $template->param(CAN_user_editcatalogue => 1); } - if ($flags->{updatecharges} == 1) { + if ($flags && $flags->{updatecharges} == 1) { $template->param(CAN_user_updatecharge => 1); } - if ($flags->{acquisition} == 1) { + if ($flags && $flags->{acquisition} == 1) { $template->param(CAN_user_acquisition => 1); } - if ($flags->{management} == 1) { + if ($flags && $flags->{management} == 1) { $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{tools} == 1) { + if ($flags && $flags->{tools} == 1) { $template->param(CAN_user_tools => 1); } } diff --git a/bull/statecollection.pl b/bull/statecollection.pl index 219345945a..c2b847a460 100755 --- a/bull/statecollection.pl +++ b/bull/statecollection.pl @@ -38,8 +38,10 @@ if ($op eq 'serialchangestatus') { if ($serialids[$i]) { serialchangestatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i]) unless ($hassubscriptionexpired && $oldstatus == 1); } else { - my $subscription=getsubscription($subscriptionid); - newissue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i], format_date_in_iso($planneddates[$i])); + if ($serialseqs[$i]) { + my $subscription=getsubscription($subscriptionid); + newissue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i], format_date_in_iso($planneddates[$i])); + } } } }