Bug 18422

Summary: Add Select2 to authority editor
Product: Koha Reporter: Oleg Vasylenko <synapse.ova>
Component: CatalogingAssignee: Oleg Vasylenko <synapse.ova>
Status: CLOSED FIXED QA Contact: Julian Maurice <julian.maurice>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, julian.maurice, katrin.fischer, m.de.rooy, paul.poulain
Version: MainKeywords: Academy
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:
Bug Depends on: 13501    
Bug Blocks:    
Attachments: Bug 18422 - Add Select2 to authority editor
Bug 18422 - Add Select2 to authority editor
Bug 18422 - Add Select2 to authority editor
Bug 18422: (QA follow-up) Check if select2 is available before using it

Description Oleg Vasylenko 2017-04-12 07:42:54 UTC
Overview: 
Repeat tag fails if authority field has select subfield (for example, UNIMARC 700$8, 800$a)

Steps to Reproduce: 
In authority editor repeat field that has select subfield

Actual Results: 
Field does not repeat (copy is not created). 
Console shows a js TypeError in cataloging.js: «$(...).select2 is not a function»

Expected Results: 
Field will repeat (copy is created)

Additional Information:
Error happens in version 16.11+ after adding Select2 js functions. The easiest way to fix is to add Select2 to authority editor
Comment 1 Oleg Vasylenko 2017-04-12 07:49:33 UTC
Created attachment 62070 [details] [review]
Bug 18422 - Add Select2 to authority editor

This patch add Select2 to authority editor
Comment 2 Fridolin Somers 2017-09-15 09:50:02 UTC
This is no enhancement but a real bug with a dirty JS error.
Comment 3 Fridolin Somers 2017-09-15 09:52:24 UTC
Created attachment 67142 [details] [review]
Bug 18422 - Add Select2 to authority editor

Overview:
Repeat tag fails if authority field has select subfield (for example, UNIMARC 700$8, 800$a)
This patch adds Select2 to authority editor

Steps to Reproduce:
In authority editor repeat field that has select subfield

Actual Results:
Field does not repeat (copy is not created).
Console shows a js TypeError in cataloging.js: «$(...).select2 is not a function»

Expected Results:
Field will repeat (copy is created)

Additional Information:
Error happens in version 16.11+ after adding Select2 js functions. The easiest way to fix is to add Select2 to authority editor

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 4 Fridolin Somers 2017-09-15 09:53:48 UTC
Works fine.
Also tested that auto-completion works in the select in authority edition.
Comment 5 Julian Maurice 2017-09-29 13:56:09 UTC
Created attachment 67451 [details] [review]
Bug 18422 - Add Select2 to authority editor

Overview:
Repeat tag fails if authority field has select subfield (for example, UNIMARC 700$8, 800$a)
This patch adds Select2 to authority editor

Steps to Reproduce:
In authority editor repeat field that has select subfield

Actual Results:
Field does not repeat (copy is not created).
Console shows a js TypeError in cataloging.js: «$(...).select2 is not a function»

Expected Results:
Field will repeat (copy is created)

Additional Information:
Error happens in version 16.11+ after adding Select2 js functions. The easiest way to fix is to add Select2 to authority editor

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Julian Maurice 2017-09-29 13:56:12 UTC
Created attachment 67452 [details] [review]
Bug 18422: (QA follow-up) Check if select2 is available before using it

cataloging.js might not always be loaded with select2.js, so we should
check its availability to prevent JS errors

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Jonathan Druart 2017-09-29 20:17:44 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-10-27 12:33:22 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 9 Katrin Fischer 2017-10-29 18:27:00 UTC
These patches have been pushed to 16.11.x and will be in 16.11.14.