From b34ac72c5a3a126f24e0ead9fca1049ec247f72c Mon Sep 17 00:00:00 2001 From: Hector Castro Date: Thu, 21 Jan 2016 15:00:00 -0600 Subject: [PATCH] Bug 14489: Patron card creator fail when login with database administrator account To reproduce the issue: 1)Log in as database administrator account. 2)Goto Tools > Patron card creator > Batches > New > Card batch 3)Get notice the label "Current library: NO_LIBRARY_SET" 4)Add a borrowernumber like 51 and click in button Add patron(s) 5)The error is launched. 6)Log out the user and login with another admin account with the librarian permissions. 7)Repeat the steps 1 to 6. To test: -Apply patch -Follow steps 1 to 6 -Notice about the new informational message "Set library" -Also see the warning message displayed when add patron 51. Koha should not fail --- .../intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt | 9 +++++++++ patroncards/edit-batch.pl | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt index 5ae465a..408bca1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt @@ -254,6 +254,15 @@ [% ELSE %]
+ [% IF LoginBranchname == 'NO_LIBRARY_SET' %] +
  1. +
    +

    Set library

    +

    You have not chosen a library, please select one. Set library

    +

    Warning: This could happen because you're logged in with the database administrator account.

    +
    +
+ [% END %]
  1. There are no patrons in this batch yet

    diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 621281b..f80a86f 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -98,12 +98,12 @@ if ($bor_num_list) { } $batch_id = $batch->get_attr('batch_id') if $batch_id == 0; #update batch_id if we added to a new batch if ($err) { - print $cgi->redirect("edit-batch.pl?op=edit&batch_id=$batch_id&error=401"); + print $cgi->redirect("edit-batch.pl?op=add&batch_id=$batch_id&error=401"); exit; } } else { - print $cgi->redirect("edit-batch.pl?op=edit&batch_id=$batch_id&error=402"); + print $cgi->redirect("edit-batch.pl?op=add&batch_id=$batch_id&error=402"); exit; } } -- 1.7.10.4