From ad73b7ea8cec29ff5eed2622317c7f1a6841b78c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 2 Jun 2014 12:44:49 -0400 Subject: [PATCH] Bug 12346 - False patron modification alerts on members-home.pl Due to the way members-home.pl handles the variable $branch, the number of patron modifications listed on members-home.pl may differ from the number listed on mainpage.pl. When the librarian clicks this link, he or she may see a different number than was listed, or none at all! Test Plan: 1) Create a number of modification request for BranchA 2) Log into the staff intranet and set your branch to BranchB 3) Note the modifications alert to does display on mainpage.pl 4) Click the "Patrons" link to take you to members-home.pl 5) Note the modifictions alert does display on this page 6) Apply this patch 7) Reload members-home.pl, note the alert no longer displays --- members/members-home.pl | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/members/members-home.pl b/members/members-home.pl index 9d1e3e5..22d7a76 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -33,7 +33,7 @@ my $branch = $query->param('branchcode'); $branch = q{} unless defined $branch; -my ($template, $loggedinuser, $cookie) +my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user({template_name => "members/member.tmpl", query => $query, type => "intranet", @@ -78,7 +78,12 @@ else { my $pending_borrower_modifications = - Koha::Borrower::Modifications->GetPendingModificationsCount( $branch ); + Koha::Borrower::Modifications->GetPendingModificationsCount( + C4::Context->preference("IndependentBranches") + && !$flags->{'superlibrarian'} + ? C4::Context->userenv()->{'branch'} + : undef + ); $template->param( "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1", -- 1.7.2.5