[Koha-bugs] [Bug 31497] Quick add: mandatory fields save as empty when not filled in before first save attempt

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 20 23:38:27 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31497

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #140606|0                           |1
        is obsolete|                            |

--- Comment #8 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 140808
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140808&action=edit
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 at davidnind.com>

Signed-off-by: Michaela Sieber <michaela.sieber at kit.edu>
Signed-off-by: Chris Cormack <chris at bigballofwax.co.nz>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list