At present when creating a patron category the user can select a date from the date picker which is earlier than the current date, meaning patrons created from the patron category have a dateexpire before they were even created. The fix of this bug is to implement a javascript message informing the user that the date they selected from the datepicker is invalid and forcing them to choose a new date before they can submit the form.
Check out the options for the datepicker widget which can limit the range of dates which will be accepted. https://jqueryui.com/datepicker/#min-max For instance, in returns.tt starting at line 60. That template also has some back-up date testing in case someone types an invalid date directly.
Still valid, resetting to master and rephrasing/shortening bug title a bit.
(In reply to Katrin Fischer from comment #2) > Still valid, resetting to master and rephrasing/shortening bug title a bit. I have tried to fix this to no avail. Min-max were specified but did not work. Am resetting to new as someone more familiar with Javascript may wish to have a crack at it.
Created attachment 87878 [details] [review] Bug 18011: Enrollment period date on patron category can be set in the past without any error/warning messages This patch modifies the patron category edit form so that the enrollment period datepicker widget cannot be used to select a date in the past. The <input> element had a "datepicker" class, which triggers a default datepicker configuration. This was overriding the configuration in the page-specific JavaScript file. To test, apply the patch and go to Administration -> Patron categories. Click the "Enrollment period -> Until date" field and verify that dates before today are disabled.
Created attachment 87935 [details] [review] Bug 18011: Enrollment period date on patron category can be set in the past without any error/warning messages This patch modifies the patron category edit form so that the enrollment period datepicker widget cannot be used to select a date in the past. The <input> element had a "datepicker" class, which triggers a default datepicker configuration. This was overriding the configuration in the page-specific JavaScript file. To test, apply the patch and go to Administration -> Patron categories. Click the "Enrollment period -> Until date" field and verify that dates before today are disabled. Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Created attachment 87973 [details] [review] Bug 18011: Enrollment period date on patron category can be set in the past without any error/warning messages This patch modifies the patron category edit form so that the enrollment period datepicker widget cannot be used to select a date in the past. The <input> element had a "datepicker" class, which triggers a default datepicker configuration. This was overriding the configuration in the page-specific JavaScript file. To test, apply the patch and go to Administration -> Patron categories. Click the "Enrollment period -> Until date" field and verify that dates before today are disabled. Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
backported to 18.05.x for 18.05.13