Bug 38005

Summary: 500 error on self registration when patron attribute is set as mandatory
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: PatronsAssignee: Lucas Gass (lukeg) <lucas>
Status: RESOLVED FIXED QA Contact: Pedro Amorim <pedro.amorim>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jesse, kyle.m.hall, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:
Attachments: Bug 38005: Pass opac_editable to search params when interface is OPAC
Bug 38005: Pass opac_editable to search params when interface is OPAC
Bug 38005: Pass opac_editable to search params when interface is OPAC
Bug 38005: Pass opac_editable to search params when interface is OPAC
Bug 38005: (follow-up) Add/adjust tests
Bug 38005: (follow-up) Add/adjust tests

Description Lucas Gass (lukeg) 2024-09-25 15:38:15 UTC
To recreate:
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:

Missing mandatory extended attribute (type=MANDO) at /usr/share/perl5/Exception/Class/Base.pm line 88
Comment 1 Lucas Gass (lukeg) 2024-09-25 21:27:01 UTC
Created attachment 171956 [details] [review]
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.
Comment 2 Roman Dolny 2024-10-07 21:20:53 UTC
Created attachment 172501 [details] [review]
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>
Comment 3 David Nind 2024-10-07 23:19:06 UTC
Created attachment 172504 [details] [review]
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>
Comment 4 Pedro Amorim 2024-10-08 08:25:32 UTC
Created attachment 172513 [details] [review]
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>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-10-11 08:57:41 UTC
Should we add a note about the change in the code? It might cause confusion later on.
Comment 6 Katrin Fischer 2024-10-11 09:15:41 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Katrin Fischer 2024-10-11 10:22:51 UTC
I am sorry, but this breaks the tests:
t_db_dependent_Koha_Patron_t.extended_attributes

Please fix urgently, lots of enh waiting.
Comment 8 Lucas Gass (lukeg) 2024-10-11 19:20:03 UTC
Created attachment 172702 [details] [review]
Bug 38005: (follow-up) Add/adjust tests
Comment 9 Nick Clemens (kidclamp) 2024-10-15 15:43:02 UTC
Created attachment 172784 [details] [review]
Bug 38005: (follow-up) Add/adjust tests

NC amended patch, tidied
Bug 38005: (QA follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Katrin Fischer 2024-10-16 12:37:28 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Pedro Amorim 2024-10-16 12:51:42 UTC
(In reply to Katrin Fischer from comment #10)
> Pushed for 24.11!
> 
> Well done everyone, thank you!

Removing additional_work_needed as the tests have been fixed.
Comment 12 Katrin Fischer 2024-10-16 12:52:52 UTC
(In reply to Pedro Amorim from comment #11)
> (In reply to Katrin Fischer from comment #10)
> > Pushed for 24.11!
> > 
> > Well done everyone, thank you!
> 
> Removing additional_work_needed as the tests have been fixed.

D11 just died... so I am hopeful, but not sure what's going on there...
Comment 13 Lucas Gass (lukeg) 2024-11-18 23:21:51 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 14 Fridolin Somers 2024-12-11 15:24:30 UTC
Pushed to 23.11.x for 23.11.11
Comment 15 Jesse Maseto 2025-02-03 17:00:09 UTC
Not pushed to LTS(22.11.x). Marked Resolved.

If you feel this should be in LTS(22.11.x) please reply with your reason.