Within Patron attribute types there is a checkbox to make the attribute mandatory. Some libraries need to be able to make patron attribute types mandatory on the OPAC but not the staff interface, or vise versa.
Created attachment 167500 [details] [review] Bug 35635: DB Updates
Created attachment 167501 [details] [review] Bug 35635: DO NOT PUSH - Schema updates
Created attachment 167502 [details] [review] Bug 35635: Split mandatory field into mandatory and opac_mandatory
Created attachment 167546 [details] [review] Bug 35635: Add opac_mandatory to patron attribute table
Created attachment 167548 [details] [review] Bug 35635: Add opac_mandatory to patron attribute table To test: 1. Before applying the patch go to Adminstration > Patron attribute types 2. Create or modify some attributes to be mandatory and some to not be mandatory. 3. APPLY PATCH, updatedatabase, restart_all 4. Go back to Adminstration > Patron attribute types. The patron attributes that were made mandatory should now also have the opac_mandatory field checked. 5. Make sure that you can change the correctly save the new "OPAC mandatory:" field. 6. If the 'Display in OPAC:' field is unchecked the 'OPAC mandatory:' checkbox should be disabled. 7. Mark some patron attributes as 'OPAC mandatory:'. 8. Go to the OPAC self reg page, the field should be required. 9. BAck on Adminstration > Patron attribute types check some attributes as 'OPAC mandatory:' and 'Editable in OPAC:'. 10. As a logged in OPAC user go to "Personal details" and make sure the attribute is required. 11. For the same attriubute as step 9-10 , mark as NOT 'Editable in OPAC:'. Make sure you can still save the form on the OPAC "Personal details" page.
Created attachment 167643 [details] [review] Bug 35635: DB Updates Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 167644 [details] [review] Bug 35635: DO NOT PUSH - Schema updates Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 167645 [details] [review] Bug 35635: Split mandatory field into mandatory and opac_mandatory Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 167646 [details] [review] Bug 35635: Add opac_mandatory to patron attribute table To test: 1. Before applying the patch go to Adminstration > Patron attribute types 2. Create or modify some attributes to be mandatory and some to not be mandatory. 3. APPLY PATCH, updatedatabase, restart_all 4. Go back to Adminstration > Patron attribute types. The patron attributes that were made mandatory should now also have the opac_mandatory field checked. 5. Make sure that you can change the correctly save the new "OPAC mandatory:" field. 6. If the 'Display in OPAC:' field is unchecked the 'OPAC mandatory:' checkbox should be disabled. 7. Mark some patron attributes as 'OPAC mandatory:'. 8. Go to the OPAC self reg page, the field should be required. 9. BAck on Adminstration > Patron attribute types check some attributes as 'OPAC mandatory:' and 'Editable in OPAC:'. 10. As a logged in OPAC user go to "Personal details" and make sure the attribute is required. 11. For the same attriubute as step 9-10 , mark as NOT 'Editable in OPAC:'. Make sure you can still save the form on the OPAC "Personal details" page. Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Testing notes: Everything worked according to the test plan, but one small clarification for steps #7 and 8 is that for the attributes to be on the self reg page I also had to check 'Editable in OPAC' for the attribute to appear on the self reg page.
Created attachment 174962 [details] [review] Bug 35635: (QA follow-up): fix terminology
Comment on attachment 167646 [details] [review] Bug 35635: Add opac_mandatory to patron attribute table Review of attachment 167646 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ +333,3 @@ > <th>Library limitation</th> > <th>Authorized value category</th> > <th>Mandatory</th> Looks like this should be changed to say it's about the staff interface.
db rev isn't updating the COMMENT for the "mandatory" column when in the kohastructure, it is changed. That comment ends up in Koha/Schema/Result so depending if the RM and RMaint runs dbic after a doing a databaseupdate or starting KTD they will end up with different POD in the schema files and a different checksum. Which will raise a warning latter for them or someone else. So even COMMENTs need to be in sync between a clean install and an upgraded install. About clean install vs upgraded install the column opac_mandatory has a divergence on it's COMMENT too: "on the OPAC" vs "in the OPAC" And "NOT NULL" is only present on of the two scenarios.
> and a different checksum. Which will raise a warning latter for them or someone else. The checksum check won't trip actually. It's ok in this scenario. There will still be unexpected schema class changes when running dbic later.
Created attachment 175059 [details] [review] Bug 35635: (follow-up) Fix DBRev
Created attachment 175635 [details] [review] Bug 35635: (QA follow-up): fix terminology
Thanks for the follow-up. Sorry there is still this remaining: > And "NOT NULL" is only present on one of the two scenarios. And comment 12 but it was confusing: <th>Mandatory - OPAC</th> was added. But just above there is <th>Mandatory</th> Which looks like it should be changed to say it's about the staff interface. To avoid confusion which in the worst case could raise doubts about "Mandatory" being about both staff interface and OPAC.
Follow-up updated for another terminology issue.
Created attachment 175858 [details] [review] Bug 35635: (follow-up): Mark madatory field as staff interface/OPAC
1. You need that in Koha/Schema/Result/BorrowerAttributeType.pm '+mandatory' => { is_boolean => 1 }, + '+opac_mandatory' => { is_boolean => 1 }, The QA script caught it 2. It does not work at all, if mandatory staff-side but not opac-side, opac-memberentry displays "You have not filled out all required fields. Please fill in all missing fields and resubmit."
Created attachment 176595 [details] [review] Bug 35635: DB Updates Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176596 [details] [review] Bug 35635: DO NOT PUSH - Schema updates Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176597 [details] [review] Bug 35635: Split mandatory field into mandatory and opac_mandatory Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176598 [details] [review] Bug 35635: Add opac_mandatory to patron attribute table To test: 1. Before applying the patch go to Adminstration > Patron attribute types 2. Create or modify some attributes to be mandatory and some to not be mandatory. 3. APPLY PATCH, updatedatabase, restart_all 4. Go back to Adminstration > Patron attribute types. The patron attributes that were made mandatory should now also have the opac_mandatory field checked. 5. Make sure that you can change the correctly save the new "OPAC mandatory:" field. 6. If the 'Display in OPAC:' field is unchecked the 'OPAC mandatory:' checkbox should be disabled. 7. Mark some patron attributes as 'OPAC mandatory:'. 8. Go to the OPAC self reg page, the field should be required. 9. BAck on Adminstration > Patron attribute types check some attributes as 'OPAC mandatory:' and 'Editable in OPAC:'. 10. As a logged in OPAC user go to "Personal details" and make sure the attribute is required. 11. For the same attriubute as step 9-10 , mark as NOT 'Editable in OPAC:'. Make sure you can still save the form on the OPAC "Personal details" page. Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176599 [details] [review] Bug 35635: (follow-up) Fix DBRev Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176600 [details] [review] Bug 35635: (QA follow-up): fix terminology Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176601 [details] [review] Bug 35635: (follow-up): Mark madatory field as staff interface/OPAC Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176602 [details] [review] Bug 35635: Flag opac_mandatory as boolean Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176603 [details] [review] Bug 35635: Fix server-side check Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 176604 [details] [review] Bug 35635: Adjust atomic update So that we don't do anything if the new column exists already.