[Bug 34671] New: Collapsing fields in patron form allows saving without mandatory fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Bug ID: 34671 Summary: Collapsing fields in patron form allows saving without mandatory fields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: emmi.takkinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com We've had cases where user has been able to save patron without address. It turned out that if one collapses patron entry fields validating those fields no longer works even if they are marked as mandatory. To reproduce: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" section. 5. Attempt to save again. => Patron is saved successfully without address information. I'm using address section as an example here, but this happens with every other fields as well. I was able to save patron without surname and date of birth this way. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |emmi.takkinen@koha-suomi.fi |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #1 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Adding "ignore" rule as "" for entry forms validation (members.js line 242) does the trick. However "This field is required." errors aren't visible when fields are collapsed. Either there should be some error displayed next to field sets name or some sort of "There are some required fields missing. Please check form." text displayed. Or maybe collapsed fields should be opened if they contain required fields. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #2 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 155643 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155643&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #3 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Currently this breaks child patron modification. Relationship input is always mandatory if borrowerRelationship syspref is set and it's also always hidden. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #4 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 156145 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156145&action=edit Bug 34671: Ignore new_guarantor_relationship input if it's hidden Validating patron forms hidden fields causes problems when adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. This patch adds class ignore_validation to relationship input if it's hidden to ignore validatation and removes it when input is displayed, so it is validated. To test: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Kelly McElligott <kelly@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kelly@bywatersolutions.com --- Comment #5 from Kelly McElligott <kelly@bywatersolutions.com> --- Upon testing this, I did see the error message under the collapsed address field, so that works successfully. However, I did not see the same error on the Guarantor Collapsed field. I can not save the form without the relationship of the guarantor, but that does not show if the field is collapsed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155643|0 |1 is obsolete| | --- Comment #6 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 156263 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156263&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156145|0 |1 is obsolete| | --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 156264 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156264&action=edit Bug 34671: Ignore new_guarantor_relationship input if it's hidden Validating patron forms hidden fields causes problems when adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. This patch adds class ignore_validation to relationship input if it's hidden to ignore validatation and removes it when input is displayed, so it is validated. To test: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed issue Kelly pointed out. There was also problem when adding guarantee via "Add guarantee" option. Just a node, I made these two patches for mainly testing purposes. They can be squashed together if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- I would suggest this change to the text: "There are some required fields missing from this section. Please complete them." And I think it looks better when the new message appears after the <legend> not before it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156263|0 |1 is obsolete| | --- Comment #10 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 156453 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156453&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156264|0 |1 is obsolete| | --- Comment #11 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 156454 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156454&action=edit Bug 34671: Ignore new_guarantor_relationship input if it's hidden adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. This patch adds class ignore_validation to relationship input if it's hidden to ignore validatation and removes it when input is displayed, so it is validated. To test: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #12 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Owen Leonard from comment #9)
I would suggest this change to the text:
"There are some required fields missing from this section. Please complete them."
And I think it looks better when the new message appears after the <legend> not before it.
Adjusted as suggested. And it does look better now :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #13 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- There's still a problem with how this behaves with patron attribute types set as required. Even if they aren't needed for certain type of patron and are hidden from form, they're still required and prevent save. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #14 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158168&action=edit Bug 34671: Ignore validation if patron attribute field is hidden Patron attributes not used by patron category are still present in form as hidden and marked as required if they are set as mandatory. This prevents saving patron when validation is required also for hidden fields. This patch adds and removes class "ignore_validation" for these fields based on their visibility. To test: 1. Add patron attribute for patron category A and set it as mandatory. 2. Add patron with category B and fill in required fields. 3. Attempt to save. => Error is displayed above "Additional attributes and identifiers" field set. 4. Apply this patch. 5. Repeat steps 2 and 3. => Save successfully. 6. Add new patron with category B, but this time change patrons category as A from patron form. => Confirm that madatory patron attribute is displayed correctly and without it patron cannot be saved. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #15 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- This still needs some work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158168|0 |1 is obsolete| | --- Comment #16 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158299&action=edit Bug 34671: Ignore validation if patron attribute field is hidden Patron attributes not used by patron category are still present in form as hidden and marked as required if they are set as mandatory. This prevents saving patron when validation is required also for hidden fields. This patch adds and removes class "ignore_validation" for these fields based on their visibility. To test: 1. Add patron attribute for patron category A and set it as mandatory. 2. Add patron with category B and fill in required fields. 3. Attempt to save. => Error is displayed above "Additional attributes and identifiers" field set. 4. Apply this patch. 5. Repeat steps 2 and 3. => Save successfully. 6. Add new patron with category B, but this time change patrons category as A from patron form. => Confirm that madatory patron attribute is displayed correctly and without it patron cannot be saved. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156453|0 |1 is obsolete| | --- Comment #17 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 158524 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158524&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy Signed-off-by: Kelly <kelly@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156454|0 |1 is obsolete| | --- Comment #18 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 158525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158525&action=edit Bug 34671: Ignore new_guarantor_relationship input if it's hidden Validating patron forms hidden fields causes problems when adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. This patch adds class ignore_validation to relationship input if it's hidden to ignore validatation and removes it when input is displayed, so it is validated. To test: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy Signed-off-by: Kelly <kelly@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158299|0 |1 is obsolete| | --- Comment #19 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 158526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158526&action=edit Bug 34671: Ignore validation if patron attribute field is hidden Patron attributes not used by patron category are still present in form as hidden and marked as required if they are set as mandatory. This prevents saving patron when validation is required also for hidden fields. This patch adds and removes class "ignore_validation" for these fields based on their visibility. To test: 1. Add patron attribute for patron category A and set it as mandatory. 2. Add patron with category B and fill in required fields. 3. Attempt to save. => Error is displayed above "Additional attributes and identifiers" field set. 4. Apply this patch. 5. Repeat steps 2 and 3. => Save successfully. 6. Add new patron with category B, but this time change patrons category as A from patron form. => Confirm that madatory patron attribute is displayed correctly and without it patron cannot be saved. Sponsored-by: Koha-Suomi Oy Signed-off-by: Kelly <kelly@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Kelly McElligott <kelly@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #20 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + ignore: "", Default should be :hidden. Does this make a difference? Comparing with + if($(".new_guarantor_relationship").is(":hidden")){ + $(".new_guarantor_relationship").addClass("ignore_validation"); + } - ignore: "", + ignore: ".ignore_validation", Also third patch. My first thought here is that we are doing things too complicated? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Failing QA for feedback on comment#20. -- You are receiving this mail because: You are watching all bug changes.
+ ignore: "", Default should be :hidden. Does this make a difference? Hmm, if ignore setting isn't set then yes, default is ":hidden". That's why it has to be set as ignore: "" so that all fields are validated no matter if
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #22 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Marcel de Rooy from comment #20) they're hidden or not. If we add class to this setting, only those fields are ignored.
Comparing with + if($(".new_guarantor_relationship").is(":hidden")){ + $(".new_guarantor_relationship").addClass("ignore_validation"); + }
- ignore: "", + ignore: ".ignore_validation",
Also third patch. My first thought here is that we are doing things too complicated? How form validation works does make things complicated because the way it works (as stated above). I did at one point test if we could leave class "required" out if field is hidden but I can't remember if it's even possible or less complicated to achieve than new class.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Anni Rajala <anni.rajala@turku.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anni.rajala@turku.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #23 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Ah, something in current main has broken this. So I might as well do some rework with this and see if there is a simpler solution to fix this :D -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #24 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixes in two last patches can indeed be achieved without using new class. Attribute required just needs to be removed and added properly based on inputs visibility and patron attributes properties. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158524|0 |1 is obsolete| | --- Comment #25 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 184067 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184067&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158525|0 |1 is obsolete| | --- Comment #26 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 184068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184068&action=edit Bug 34671: Ignore new_guarantor_relationship and patron attribute inputs if they are hidden Validating patron forms hidden fields causes problems when adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. Also patron attributes not used by patron category are still present in form as hidden and marked as required if they are set as mandatory. This patch removes and adds attribute required to these fields based on their visibility. To test guarantor relationship: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. To test patron attributes: 1. Add patron attribute for patron category A and set it as mandatory. 2. Add patron with category B and fill in required fields. 3. Attempt to save. => Error is displayed above "Additional attributes and identifiers" field set. 4. Apply this patch. 5. Repeat steps 2 and 3. => Save successfully. 6. Add new patron with category B, but this time change patrons category as A from patron form. => Confirm that mandatory patron attribute is displayed correctly and without it patron cannot be saved. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158526|0 |1 is obsolete| | --- Comment #27 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 184069 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184069&action=edit Bug 34671: Add error message before legend If error message was added after legend collapsing fields no longer works as expected. This patch fixes this. To test: 1. Confirm that error message "There are some required fields..." is displayed above field sets legend. 2. Collapsing field set field works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 David Flater <flaterdavid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184069|0 |1 is obsolete| | --- Comment #28 from David Flater <flaterdavid@gmail.com> --- Created attachment 185285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185285&action=edit Bug 34671: Add error message before legend If error message was added after legend collapsing fields no longer works as expected. This patch fixes this. To test: 1. Confirm that error message "There are some required fields..." is displayed above field sets legend. 2. Collapsing field set field works as expected. Signed-off-by: David Flater <flaterdavid@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 David Flater <flaterdavid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |flaterdavid@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Lucy Vaux-Harvey <lucy.vaux-harvey@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucy.vaux-harvey@openfifth. | |co.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Please run qa tools. Seeing failures on members.js and memberentrygen.tt. SyntaxError: Unexpected closing tag "select". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #30 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Marcel de Rooy from comment #29)
Please run qa tools. Seeing failures on members.js and memberentrygen.tt. SyntaxError: Unexpected closing tag "select".
Ran QA tool after updating it and I'm not seeing this error. What I got is: testing 3 commit(s) (applied to a869b72 '7f Bug 36942: Use an exception for a ') Processing files before patches |========================>| 3 / 3 (100.00%) Processing files after patches |========================>| 3 / 3 (100.00%) OK koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc OK filters OK forbidden patterns OK git manipulation OK js_in_body SKIP spelling OK tt_valid OK valid_template FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt OK filters OK forbidden patterns OK git manipulation OK js_in_body SKIP spelling FAIL tt_valid lines 310, 334, 351, 360, 369, 378, 399, 408, 418, 521, 522, 562, 563, 642, 653, 664, 665, 699, 710, 720, 730, 745, 759, 769, 968, 978, 1100, 1112, 1113, 1130, 1141, 1163, 1190, 1241 OK valid_template OK koha-tmpl/intranet-tmpl/prog/js/members.js OK Tidiness OK git manipulation Processing additional checks OK! However, bug 39189 has made some changes to memberentrygen.tt which are overwritten when I apply these patches and that shouldn't happen. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #31 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Updated qa-tools again, now I'm getting proper errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #32 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 186952 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186952&action=edit Bug 34671: Fix QA issues This patch fixes issue with orphan select closing tag and tidies the code. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #33 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed QA issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #34 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 190021 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190021&action=edit Bug 34671: Ignore hidden dateofbirth field Flatpicker adds its own field as date of birth field and simply hides the input field its added to. This lead to situation where if date of birth field was empty, "This field is required" message was still added to hidden input field. This patch adds "dateofbirth" field as ignored field in form validation function to prevent extra required message. To test: 1. Make sure date of birth field is mandatory. 2. Add or modify patron and leave date of birth field empty. 3. Attempt to save the patron. => Note that "This field is required" message is displayed before and after date of birth field. 4. Apply this patch. 5. Repeat steps 2. and 3. => Note that message is now displayed only after the date of birth field. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #35 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 190024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190024&action=edit Bug 34671: Fix validating hidden mandatory patron attribute fields Hidden mandatory patron attribute field were still causing problems while saving. Class required was added even if the attribute wasn't tied to patrons category. To test: 1. Add patron attribute to some patron category and set it as mandatory. 2. Add or modify patron with different category. 3. Attempt to save. => Make sure saving the patron is succesful. 4. Add or modify patron with category where you added mandatory attribute. => Make sure that attribute is displayed in form and it's manadatory. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 --- Comment #36 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- There we're still couple things to fix but now this is ready for testing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Chris Mathevet <chris.mathevet@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |chris.mathevet@inLibro.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184067|0 |1 is obsolete| | --- Comment #37 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198691 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198691&action=edit Bug 34671: Show error message if fieldset has invalid input If fieldset is collapsed and it contains required fields patron can be saved without filling these fields. This patch adds rule ignore as "" in form validation and displayes error message in fieldsets containing missing required inputs. To test: 1. Make sure you have "Main address" fields set as mandatory with BorrowerMandatoryField syspref (address, city, zipcode) 2. Add new patron, fill in some info, but leave "Main address" fields empty. 3. Attempt to save. => "This field is mandatory" should be displayed next to the address fields. 4. Collapse "Main address" fieldset. 5. Attempt to save again. => Patron is saved successfully without address information. 6. Apply this patch. 7. Edit patron and attempt to save again with "Main address" fieldset collapsed. => Error message "There are some required fields missing from this field set. Please fill them." should be displayed and patron isn't saved. 8. Fill missing fields, attempt to save. => Saving should now be successfull. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184068|0 |1 is obsolete| | --- Comment #38 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198692 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198692&action=edit Bug 34671: Ignore new_guarantor_relationship and patron attribute inputs if they are hidden Validating patron forms hidden fields causes problems when adding/modifying guarantee patrons since class new_guarantor_relationship is always hidden and mandatory if syspref "borrowerRelationship" is set. Also patron attributes not used by patron category are still present in form as hidden and marked as required if they are set as mandatory. This patch removes and adds attribute required to these fields based on their visibility. To test guarantor relationship: 1. Apply previous patch. 2. Add or modify guarantee patron. 3. Do not add or modify guarantor. 4. Attempt to save patron. => Pressing save button does nothing and no error is displayed. 5. Apply this patch. 6. Again add or modify guarantee patron and don't add or modify guarantor. 7. Attempt to save. => Saving should now be successfull. 8. Again, add or modify guarantee patron, but this time also add or modify guarantor. 9. Leave relationship input empty. 10. Attempt to save. => Saving should fail and error "There are some required fields missing..." should be displayed on top of "Patron guarantor" field set. 11. Add relationship for guarantor and save. => Saving should now be successfull. To test patron attributes: 1. Add patron attribute for patron category A and set it as mandatory. 2. Add patron with category B and fill in required fields. 3. Attempt to save. => Error is displayed above "Additional attributes and identifiers" field set. 4. Apply this patch. 5. Repeat steps 2 and 3. => Save successfully. 6. Add new patron with category B, but this time change patrons category as A from patron form. => Confirm that mandatory patron attribute is displayed correctly and without it patron cannot be saved. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185285|0 |1 is obsolete| | --- Comment #39 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198693&action=edit Bug 34671: Add error message before legend If error message was added after legend collapsing fields no longer works as expected. This patch fixes this. To test: 1. Confirm that error message "There are some required fields..." is displayed above field sets legend. 2. Collapsing field set field works as expected. Signed-off-by: David Flater <flaterdavid@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186952|0 |1 is obsolete| | --- Comment #40 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198694&action=edit Bug 34671: Fix QA issues This patch fixes issue with orphan select closing tag and tidies the code. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190021|0 |1 is obsolete| | --- Comment #41 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198695&action=edit Bug 34671: Ignore hidden dateofbirth field Flatpicker adds its own field as date of birth field and simply hides the input field its added to. This lead to situation where if date of birth field was empty, "This field is required" message was still added to hidden input field. This patch adds "dateofbirth" field as ignored field in form validation function to prevent extra required message. To test: 1. Make sure date of birth field is mandatory. 2. Add or modify patron and leave date of birth field empty. 3. Attempt to save the patron. => Note that "This field is required" message is displayed before and after date of birth field. 4. Apply this patch. 5. Repeat steps 2. and 3. => Note that message is now displayed only after the date of birth field. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190024|0 |1 is obsolete| | --- Comment #42 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 198696 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198696&action=edit Bug 34671: Fix validating hidden mandatory patron attribute fields Hidden mandatory patron attribute field were still causing problems while saving. Class required was added even if the attribute wasn't tied to patrons category. To test: 1. Add patron attribute to some patron category and set it as mandatory. 2. Add or modify patron with different category. 3. Attempt to save. => Make sure saving the patron is succesful. 4. Add or modify patron with category where you added mandatory attribute. => Make sure that attribute is displayed in form and it's manadatory. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #43 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Rebased patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671 Chris Mathevet <chris.mathevet@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #44 from Chris Mathevet <chris.mathevet@inLibro.com> --- "Ignore new_guarantor_relationship and patron attribute inputs if they are hidden" When changing patron category, new mandatory field appear, but when left blank and saved button pressed, an error 500 occurs. Logs: - AH01215: Missing mandatory extended attribute (type=C), referer : /cgi-bin/koha/members/memberentry.pl?op=add_form&categorycode=B - End of script output before headers: memberentry.pl, referer : /cgi-bin/koha/members/memberentry.pl?op=add_form&categorycode=B To reproduce: 1 - Add new category A 2 - Add new category B 3 - Add new patron attribute type C, add "Staff interface mandatory", apply to category A 4 - Add new patron category B 5 - Fill in the mandatory fields 6 - Change patron category from B to A, field for attribute C appear 7 - Leave field for attribute C blank 8 - Click on save button 9 - Error 505 appear -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org