Bug 30775 - 952w should have datepicker plugin enabled for it by default
Summary: 952w should have datepicker plugin enabled for it by default
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Peter Vashchuk
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-16 14:02 UTC by Peter Vashchuk
Modified: 2023-06-08 22:26 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the date picker to 952$w (price effective from). This improves usability (952$d (date acquired) has the date picker enabled) and also adds date field validation (the date is added to the database as YYYY-MM-DD and when entered incorrectly it can lead to crashes in other areas).
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Circulation function:


Attachments
Bug 30775: Make 952w to have datepicker plugin by default (1.83 KB, patch)
2022-05-16 14:08 UTC, Peter Vashchuk
Details | Diff | Splinter Review
Bug 30775: Make 952w to have datepicker plugin by default (1.87 KB, patch)
2022-05-31 04:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 30775: Make 952w to have datepicker plugin by default (1.94 KB, patch)
2022-06-16 11:31 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Vashchuk 2022-05-16 14:02:30 UTC

    
Comment 1 Peter Vashchuk 2022-05-16 14:08:56 UTC
Created attachment 135018 [details] [review]
Bug 30775: Make 952w to have datepicker plugin by default

This field (Price effective from) is very similar to 952d,
but it doesn't have dateaccessioned.pl plugin by default,

Apart of worse usability of this it is also allows to enter wrong
date which will be converted in 0000-00-00 in DB and even lead to
crashes by code in other places.

So, adding this plugin not only improves usability (user can have
datepicker) but also adds date field validation.

Test plan:
1. Head over to MARC frameworks from your administration page, 
check 952 subfield structure of your default framework structure.
2. dateaccessioned.pl is set as a plugin for 952d by default 
but is missing from 952w.
3. Apply the patch and reset your koha, drop db and use reset_all alias.
4. Check frameworks structure again and ensure that datepicker plugin 
is set by default for 952w.
5. Edit some item to ensure that datepicker works for that 952w.
Comment 2 David Nind 2022-05-31 04:25:29 UTC
Created attachment 135461 [details] [review]
Bug 30775: Make 952w to have datepicker plugin by default

This field (Price effective from) is very similar to 952d,
but it doesn't have dateaccessioned.pl plugin by default,

Apart of worse usability of this it is also allows to enter wrong
date which will be converted in 0000-00-00 in DB and even lead to
crashes by code in other places.

So, adding this plugin not only improves usability (user can have
datepicker) but also adds date field validation.

Test plan:
1. Head over to MARC frameworks from your administration page,
check 952 subfield structure of your default framework structure.
2. dateaccessioned.pl is set as a plugin for 952d by default
but is missing from 952w.
3. Apply the patch and reset your koha, drop db and use reset_all alias.
4. Check frameworks structure again and ensure that datepicker plugin
is set by default for 952w.
5. Edit some item to ensure that datepicker works for that 952w.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-05-31 04:27:17 UTC
Testing notes (using koha-testing-docker):

- For step 3: apply the patch, then reset_all ==> 952$w should have dateaccessioned.pl
Comment 4 Martin Renvoize (ashimema) 2022-06-16 11:31:58 UTC
Created attachment 136152 [details] [review]
Bug 30775: Make 952w to have datepicker plugin by default

This field (Price effective from) is very similar to 952d,
but it doesn't have dateaccessioned.pl plugin by default,

Apart of worse usability of this it is also allows to enter wrong
date which will be converted in 0000-00-00 in DB and even lead to
crashes by code in other places.

So, adding this plugin not only improves usability (user can have
datepicker) but also adds date field validation.

Test plan:
1. Head over to MARC frameworks from your administration page,
check 952 subfield structure of your default framework structure.
2. dateaccessioned.pl is set as a plugin for 952d by default
but is missing from 952w.
3. Apply the patch and reset your koha, drop db and use reset_all alias.
4. Check frameworks structure again and ensure that datepicker plugin
is set by default for 952w.
5. Edit some item to ensure that datepicker works for that 952w.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2022-06-16 11:32:26 UTC
Good call, works as described and is a sensible default.

PQA
Comment 6 Tomás Cohen Arazi (tcohen) 2022-06-27 16:25:47 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass (lukeg) 2022-07-29 16:54:05 UTC
Backported to 22.05.x for 22.05.04
Comment 8 Arthur Suzuki 2022-08-11 13:05:30 UTC
pushed to 21.11.x for 21.11.11
Comment 9 Victor Grousset/tuxayo 2022-08-13 16:30:11 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.