Bugzilla – Attachment 172504 Details for
Bug 38005
500 error on self registration when patron attribute is set as mandatory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38005: Pass opac_editable to search params when interface is OPAC
Bug-38005-Pass-opaceditable-to-search-params-when-.patch (text/plain), 2.49 KB, created by
David Nind
on 2024-10-07 23:19:06 UTC
(
hide
)
Description:
Bug 38005: Pass opac_editable to search params when interface is OPAC
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-10-07 23:19:06 UTC
Size:
2.49 KB
patch
obsolete
>From 0c63642f1dae39333071948512b4519fe7020d30 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 25 Sep 2024 21:17:22 +0000 >Subject: [PATCH] Bug 38005: Pass opac_editable to search params when interface > is OPAC > >1. Create a patron attribute. >2. Check it as Mandatory. >3. Do NOT make it display or editable in the OPAC. >4. Go to OPAC self reg form >5. You will not see the attribute. >6. Submit the form and see the 500 error. >7. Apply patch, restart_all. >8. Try again, now you should be able to submit the OPAC form. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Patron.pm | 27 ++++++++++++++++----------- > 1 file changed, 16 insertions(+), 11 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index fcbd6cd71e..cf359d4b3b 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -2182,17 +2182,22 @@ sub extended_attributes { > } > > # Check globally mandatory types >- my @required_attribute_types = >- Koha::Patron::Attribute::Types->search( >- { >- mandatory => 1, >- category_code => [ undef, $self->categorycode ], >- 'borrower_attribute_types_branches.b_branchcode' => >- undef, >- }, >- { join => 'borrower_attribute_types_branches' } >- )->get_column('code'); >- for my $type ( @required_attribute_types ) { >+ my $interface = C4::Context->interface; >+ my $params = { >+ mandatory => 1, >+ category_code => [ undef, $self->categorycode ], >+ 'borrower_attribute_types_branches.b_branchcode' => undef, >+ }; >+ >+ if ( $interface eq 'opac' ) { >+ $params->{opac_editable} = 1; >+ } >+ >+ my @required_attribute_types = Koha::Patron::Attribute::Types->search( >+ $params, >+ { join => 'borrower_attribute_types_branches' } >+ )->get_column('code'); >+ for my $type (@required_attribute_types) { > Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( > type => $type, > ) if !$new_types->{$type}; >-- >2.39.5
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 38005
:
171956
|
172501
|
172504
|
172513
|
172702
|
172784