From c8eb8cc369055b8a09d9e548be31798d4738cbcd Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 15 Apr 2020 22:46:23 +0000 Subject: [PATCH] Bug 25136: Make PatronSelfRegistrationLibraryList only effect new registration This patch makes it so PatronSelfRegistrationLibraryList will only effect the registration from and not the modification form. TO TEST: 1. Turn on self reg and add some libaries to PatronSelfRegistrationLibraryList. 2. Notice that the libaries that display in the borrower_branchcode dropdown are the ones you selected on both the new registration from and the modification form. 3. Apply patch. 4. Now only the new registration from should show libaries on PatronSelfRegistrationLibraryList. 5. The modifciation dropdown should still show all libraries. Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Jonathan Druart --- opac/opac-memberentry.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index e954587d81..05241589b6 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -76,11 +76,13 @@ my $mandatory = GetMandatoryFields($action); my @libraries = Koha::Libraries->search; if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { - @libraries = map { - my $b = $_; - my $branchcode = $_->branchcode; - ( grep { $_ eq $branchcode } @libraries_to_display ) ? $b : () - } @libraries; + if ( $action eq 'new' ) { + @libraries = map { + my $b = $_; + my $branchcode = $_->branchcode; + ( grep { $_ eq $branchcode } @libraries_to_display ) ? $b : () + } @libraries; + } } my ( $min, $max ) = C4::Members::get_cardnumber_length(); if ( defined $min ) { -- 2.20.1