Bugzilla – Attachment 34991 Details for
Bug 13526
Mandatory fields should not be able to be hidden in borrower self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13526 - Mandatory fields should not be able to be hidden in borrower self-registration
Bug-13526---Mandatory-fields-should-not-be-able-to.patch (text/plain), 2.99 KB, created by
David Cook
on 2015-01-07 06:33:44 UTC
(
hide
)
Description:
Bug 13526 - Mandatory fields should not be able to be hidden in borrower self-registration
Filename:
MIME Type:
Creator:
David Cook
Created:
2015-01-07 06:33:44 UTC
Size:
2.99 KB
patch
obsolete
>From affbdce24d87109d45a5688e8dab740b48909b25 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 7 Jan 2015 17:32:06 +1100 >Subject: [PATCH] Bug 13526 - Mandatory fields should not be able to be hidden > in borrower self-registration > >Currently, mandatory fields in the borrower self-registration can be hidden. >This causes problems since the validator rejects the registration, >even though all required fields on the screen have been filled out. > >This is especially a problem when using the system preference >"PatronSelfRegistrationVerifyByEmail", since it automatically makes >"email" a mandatory field. > >This patch makes it so that a mandatory field cannot be hidden on >the self-registration page. > >_TEST PLAN_ > >Before applying >1) Hide the "email" and the "emailpro" fields using the >"PatronSelfRegistrationBorrowerUnwantedField" system preference. > >2) Make the "email" and the "emailpro" fields mandatory using the >"PatronSelfRegistrationBorrowerMandatoryField" system preference. > >3) Note that you cannot see "Primary email" or "Secondary email" >on the self registration page. >(The registration page which can be found by turning >on "PatronSelfRegistration" and filling in >"PatronSelfRegistrationDefaultCategory". The link will be on >opac-main.pl on the right side of the screen under the login box.) > >4) Note that you cannot submit a self-registration request as >the system tells you that you have not filled in all the mandatory >fields. > >5) Apply the patch && refresh the self registration page > >6) Note that you can now see "Primary email" and "Secondary email" >on the self-registration screen". >--- > opac/opac-memberentry.pl | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 6abe803..b2b6c94 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -58,7 +58,7 @@ if ( $action eq q{} ) { > > $template->param( > action => $action, >- hidden => GetHiddenFields(), >+ hidden => GetHiddenFields($action), > mandatory => GetMandatoryFields($action), > member_titles => GetTitles() || undef, > branches => GetBranchesLoop(), >@@ -229,15 +229,21 @@ $template->param( > output_html_with_http_headers $cgi, $cookie, $template->output; > > sub GetHiddenFields { >+ my ($action) = @_; > my %hidden_fields; > > my $BorrowerUnwantedField = > C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField"); > >+ #Fetch the mandatory fields to compare against hidden fields >+ my @mandatory_fields = keys %{GetMandatoryFields($action)}; >+ > my @fields = split( /\|/, $BorrowerUnwantedField ); >- foreach (@fields) { >- next unless m/\w/o; >- $hidden_fields{$_} = 1; >+ foreach my $field (@fields) { >+ next unless $field =~ m/\w/o; >+ #Don't hide mandatory fields >+ next if grep { $_ eq $field } @mandatory_fields; >+ $hidden_fields{$field} = 1; > } > > return \%hidden_fields; >-- >1.8.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13526
:
34991
|
35029
|
35126
|
35331