Bug 19249 - Date picker broken in "Quick add new patron" form
Summary: Date picker broken in "Quick add new patron" form
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Fridolin SOMERS
QA Contact: Testopia
Depends on: 3534
  Show dependency treegraph
Reported: 2017-09-04 11:00 UTC by Fridolin SOMERS
Modified: 2017-11-21 10:12 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2017-09-04 11:00:04 UTC
If a date input like date of birth is mandatory, in quick add brief form the calendar icon appears but clicking on it does nothing.
This is because quick add brief form creates a clone of inputs in the original form.
An input with date picker is changed and linked to Javascript code (see calendar.inc) so it can not be cloned.

Note also that creating a clone of an input in another form does not update the form value in its DOM. It can generate errors.

In my opinion this feature should be reconsidered to hide unwanted fields instead of cloning wanted ones. Many bugs may be avoided.
Comment 1 Fridolin SOMERS 2017-09-04 11:02:43 UTC
Also date of birth has a small JS code showing age when date is changed.
Comment 2 Feli Kramer 2017-09-23 14:24:28 UTC
How to reproduce this bug?

1. In the system preferences, add "dateofbirth" to "Patrons > General > BorrowerMandatoryField".
2. Go to the "Patrons" page.
3. Click "Quick add new patron" and select a patron category.
4. You will be shown the brief form.
5. Click on the calendar icon next to the "Date of birth" input field.