Bug 21050

Summary: Datepickers on LabelItemSearch broken
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, julian.maurice, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 19709    
Bug Blocks:    
Attachments: Bug 21050: Fix datepickers on LabelItemSearch
Bug 21050: Fix datepickers on LabelItemSearch
Bug 21050: Fix datepickers on LabelItemSearch

Description Katrin Fischer 2018-07-07 11:58:13 UTC
Something is wrong with the JavaScript on the label item search. The visible problem is the missing datepickers on the date fields in the search form.

To test:
 - Open or create a label batch.
 - Click "Add items" to trigger the pop-up search window.
Comment 1 Jonathan Druart 2018-07-11 20:12:04 UTC
Seems ok here - https://screenshots.firefox.com/3CmAOf29z2fHLjzR/pro.kohadev.org
Comment 2 Katrin Fischer 2018-07-15 17:40:51 UTC
Strange, still broken for me.

This is the URL:
http://localhost:8081/cgi-bin/koha/labels/label-item-search.pl?batch_id=0&amp;type=labels

Looking at the source code the jquery libraries are at the bottom of the page, but there is a lot of JavaScript code above. Can you take another look and confirm you were looking on master?
Comment 3 Jonathan Druart 2018-07-16 14:13:15 UTC
Hum, it is failing now (?)

ReferenceError: _ is not defined

at line:
var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s)."));
Comment 4 Jonathan Druart 2018-07-16 14:21:45 UTC
Caused by
  commit 3c887b4e07acf9459767a7b934aa4f6c16cae534
  Bug 19709: Move template JavaScript to the footer: Labels
Comment 5 Jonathan Druart 2018-07-16 14:23:25 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2018-07-16 21:00:45 UTC Comment hidden (obsolete)
Comment 7 Julian Maurice 2018-08-08 09:25:20 UTC
Created attachment 77553 [details] [review]
Bug 21050: Fix datepickers on LabelItemSearch

calendar.inc must be in the jsinclude block when jsfooter is set

Test plan:
- Open or create a label batch.
- Click "Add items" to trigger the pop-up search window.
- Date picker should work now

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Nick Clemens (kidclamp) 2018-08-09 12:26:41 UTC
Awesome work all!

Pushed to master for 18.11
Comment 9 Martin Renvoize (ashimema) 2018-08-10 07:36:06 UTC
Depends on (and is caused by) bug 19709 not in 18.05.x series.