By default the dateaccessioned.pl cataloguing value builder is linked to the 952$d subfield. When the additem.pl page loads the 952$d is pre-populated with today's date. However, some libraries link the dateaccessioned.pl cataloguing value builder plugin to subfields displayed in the addbiblio.pl (biblio cataloguing page). For example, 902$d. When you load the addbiblio.pl page those subfields are not pre-populated with today's date. Instead in the console you get the following JavaScript error: Uncaught TypeError: $(...).flatpickr is not a function
Created attachment 135088 [details] [review] Bug 30797: Add the calendar.inc include to addbiblio.tt addbiblio.tt throws the '$(...).flatpickr is not a function' because it is missing includes to flatpickr.min.js and shortcut-buttons-flatpickr.min.js To fix this the addbiblio.tt should include the calendar.inc file (like additem.tt does) which includes to those aforementioned JS files. Test plan: 1. Edit a MARC bibliographic framework 2. Make the 902$d subfield visible in the Editor 3. Also set the 902$d subfield plugin='dateaccessioned.pl' 4. Catalogue a new biblio record 5. Notice the 902$d subfield has not been pre-populated with todays date 6. Right click, choose 'Inspect', observe this JS error in the console: "Uncaught TypeError: $(...).flatpickr is not a function" 7. Apply patch, and restart services 8. Repeat steps 4-6 and this time observe the 902$d is pre-populated, and there is no flatpickr JS error in the console Sponsored-by: Chartered Accountants Australia and New Zealand
Created attachment 135098 [details] [review] Bug 30797: Add the calendar.inc include to addbiblio.tt addbiblio.tt throws the '$(...).flatpickr is not a function' because it is missing includes to flatpickr.min.js and shortcut-buttons-flatpickr.min.js To fix this the addbiblio.tt should include the calendar.inc file (like additem.tt does) which includes to those aforementioned JS files. Test plan: 1. Edit a MARC bibliographic framework 2. Make the 902$d subfield visible in the Editor 3. Also set the 902$d subfield plugin='dateaccessioned.pl' 4. Catalogue a new biblio record 5. Notice the 902$d subfield has not been pre-populated with todays date 6. Right click, choose 'Inspect', observe this JS error in the console: "Uncaught TypeError: $(...).flatpickr is not a function" 7. Apply patch, and restart services 8. Repeat steps 4-6 and this time observe the 902$d is pre-populated, and there is no flatpickr JS error in the console Sponsored-by: Chartered Accountants Australia and New Zealand Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Taking the liberty to promote to PQA directly. Trivial fix. Note: There is a display problem with the red cross to clear the date field. I linked dateaccessioned to 100$b. The red cross is directly next to Numeration label. The Tag editor button is at the far right side. And the text field is on the line under the red cross. Could you have a look, Owen ?
Note for RM: The previous comment should not block you from pushing this one.
Created attachment 135103 [details] [review] Bug 30797: (follow-up) Hide default Flatpickr clear-field button The basic MARC editor has its own button associated with each subfield for emptying the contents of the input. Since the Flatpickr "X" icon causes a layout problem and would be redundant, we can hide it on this page.
Thank you Marcel and Owen!
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
This should be backported to 21.11
applied to 21.11.x for 21.11.13
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.
Thanks! Pushed to 21.11 for 21.11.12