Summary: | Quick add: mandatory fields save as empty when not filled in before first save attempt | ||
---|---|---|---|
Product: | Koha | Reporter: | Koha Team University Lyon 3 <koha> |
Component: | Patrons | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P3 | CC: | arthur.suzuki, gmcharlt, koha, kyle.m.hall, lucas, m.de.rooy, sally.healey, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.07, 21.11.14
|
|
Circulation function: | |||
Attachments: |
Bug 31497: Prevent ID clash on quick add fields
Bug 31497: Prevent ID clash on quick add fields Bug 31497: Prevent ID clash on quick add fields Bug 31497: (follow-up) Expand ID suffix, fix password2, remove debug Bug 31497: Prevent ID clash on quick add fields Bug 31497: (follow-up) Expand ID suffix, fix password2, remove debug |
Description
Koha Team University Lyon 3
2022-08-31 13:08:24 UTC
This bug is also present in current master (development branch). To test: * Go to patrons module * Click on Quick add new patron (I chose Patron as category) * On sample database these fields are marked as mandatory: * Surname * Cardnumber * Library * Category * Fill in Surname, leave cardnumber empty * Save - mandatory message is shown * Fill in cardnumber - save * The patron is saved * BUT: cardnumber is empty! Updating to major for data loss. Created attachment 140568 [details] [review] Bug 31497: Prevent ID clash on quick add fields The quick add clones the original fields, including ids. This can cause some clash when other JS is running on the page. This patch updates the ids of the fields before adding to the form, which prevents bad copying/clearing of fields To test: * Go to patrons module * Click on Quick add new patron (I chose Patron as category) * On sample database these fields are marked as mandatory: * Surname * Cardnumber * Library * Category * Fill in Surname, leave cardnumber empty * Save - mandatory message is shown * Fill in cardnumber - save * The patron is saved * BUT: cardnumber is empty! APPLY PATCH * Repeat plan above * Cardnumber is correctly saved Created attachment 140603 [details] [review] Bug 31497: Prevent ID clash on quick add fields The quick add clones the original fields, including ids. This can cause some clash when other JS is running on the page. This patch updates the ids of the fields before adding to the form, which prevents bad copying/clearing of fields To test: * Go to patrons module * Click on Quick add new patron (I chose Patron as category) * On sample database these fields are marked as mandatory: * Surname * Cardnumber * Library * Category * Fill in Surname, leave cardnumber empty * Save - mandatory message is shown * Fill in cardnumber - save * The patron is saved * BUT: cardnumber is empty! APPLY PATCH * Repeat plan above * Cardnumber is correctly saved Signed-off-by: David Nind <david@davidnind.com> Created attachment 140606 [details] [review] Bug 31497: Prevent ID clash on quick add fields The quick add clones the original fields, including ids. This can cause some clash when other JS is running on the page. This patch updates the ids of the fields before adding to the form, which prevents bad copying/clearing of fields To test: * Go to patrons module * Click on Quick add new patron (I chose Patron as category) * On sample database these fields are marked as mandatory: * Surname * Cardnumber * Library * Category * Fill in Surname, leave cardnumber empty * Save - mandatory message is shown * Fill in cardnumber - save * The patron is saved * BUT: cardnumber is empty! APPLY PATCH * Repeat plan above * Cardnumber is correctly saved Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> child_input.attr("id") + "_qa" Please clarify :) + console.log( orig_input_id); Debug ? (In reply to Marcel de Rooy from comment #5) > child_input.attr("id") + "_qa" > Please clarify :) > If you want to prevent clashing, wouldnt you need a more robust suffix? Created attachment 140703 [details] [review] Bug 31497: (follow-up) Expand ID suffix, fix password2, remove debug Created attachment 140808 [details] [review] Bug 31497: Prevent ID clash on quick add fields The quick add clones the original fields, including ids. This can cause some clash when other JS is running on the page. This patch updates the ids of the fields before adding to the form, which prevents bad copying/clearing of fields To test: * Go to patrons module * Click on Quick add new patron (I chose Patron as category) * On sample database these fields are marked as mandatory: * Surname * Cardnumber * Library * Category * Fill in Surname, leave cardnumber empty * Save - mandatory message is shown * Fill in cardnumber - save * The patron is saved * BUT: cardnumber is empty! APPLY PATCH * Repeat plan above * Cardnumber is correctly saved Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 140809 [details] [review] Bug 31497: (follow-up) Expand ID suffix, fix password2, remove debug Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for upcoming 22.05.07 release applied to 21.11 for 21.11.14 21.05.x not affected, no backport. Nothing to document, marking resolved. *** Bug 30978 has been marked as a duplicate of this bug. *** *** Bug 29303 has been marked as a duplicate of this bug. *** |