Bug 22242 - Javascript error in value builder cased by Select2
Summary: Javascript error in value builder cased by Select2
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Josef Moravec
URL:
Keywords:
Depends on: 17780
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-31 08:11 UTC by Fridolin Somers
Modified: 2020-01-06 20:14 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Same as Bug 17780 but in value builders. (2.96 KB, patch)
2019-01-31 08:30 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 22242: Javascript error in value builder cased by Select2 (3.07 KB, patch)
2019-02-01 19:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22242: Javascript error in value builder cased by Select2 (3.14 KB, patch)
2019-02-02 09:43 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2019-01-31 08:11:38 UTC
Same as Bug 17780 but in value builders.

Select2 (Bug 13501) introduced divs and inputs that broke some assumptions about the expected HTML structure.
This patch checks if input has name attribute, because some inputs in Select2 have not.

It brakes value builders marc21_linking_section.tt and unimarc_field_4XX.tt.
Comment 1 Fridolin Somers 2019-01-31 08:30:06 UTC
Created attachment 84565 [details] [review]
Same as Bug 17780 but in value builders.

Select2 (Bug 13501) introduced divs and inputs that broke some assumptions about the expected HTML structure.
This patch checks if input has name attribute, because some inputs in Select2 have not.

It brakes value builders marc21_linking_section.tt and unimarc_field_4XX.tt.

Test plan :
1) On a MARC21 database
2) Define 774$0 as a regular subfield
3) Define 774$4 with an authorised value category
4) Define 774$t with value builder marc21_linking_section
5) Create a new record
6) Use value builder in 774$t
7) Search for a record and click choose
8) Without patch : a popup window does not close and show a blank screen
9) With patch : popup windows get close and you see in field 774 $0 and $t field with values
10) Same tests with a UNIMARC database on field 461 with value builder unimarc_field_4XX.tt
Comment 2 Owen Leonard 2019-02-01 19:15:41 UTC
Created attachment 84641 [details] [review]
Bug 22242: Javascript error in value builder cased by Select2

Same as Bug 17780 but in value builders.

Select2 (Bug 13501) introduced divs and inputs that broke some
assumptions about the expected HTML structure. This patch checks if
input has name attribute, because some inputs in Select2 have not.

It brakes value builders marc21_linking_section.tt and
unimarc_field_4XX.tt.

Test plan :
1)  On a MARC21 database
2)  Define 774$0 as a regular subfield
3)  Define 774$4 with an authorised value category
4)  Define 774$t with value builder marc21_linking_section
5)  Create a new record
6)  Use value builder in 774$t
7)  Search for a record and click choose
8)  Without patch : a popup window does not close and show a blank
    screen
9)  With patch : popup windows get close and you see in field 774 $0 and
    $t field with values
10) Same tests with a UNIMARC database on field 461 with value builder
    unimarc_field_4XX.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested successfully with MARC21
Comment 3 Josef Moravec 2019-02-02 09:43:12 UTC
Created attachment 84656 [details] [review]
Bug 22242: Javascript error in value builder cased by Select2

Same as Bug 17780 but in value builders.

Select2 (Bug 13501) introduced divs and inputs that broke some
assumptions about the expected HTML structure. This patch checks if
input has name attribute, because some inputs in Select2 have not.

It brakes value builders marc21_linking_section.tt and
unimarc_field_4XX.tt.

Test plan :
1)  On a MARC21 database
2)  Define 774$0 as a regular subfield
3)  Define 774$4 with an authorised value category
4)  Define 774$t with value builder marc21_linking_section
5)  Create a new record
6)  Use value builder in 774$t
7)  Search for a record and click choose
8)  Without patch : a popup window does not close and show a blank
    screen
9)  With patch : popup windows get close and you see in field 774 $0 and
    $t field with values
10) Same tests with a UNIMARC database on field 461 with value builder
    unimarc_field_4XX.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested successfully with MARC21

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Nick Clemens 2019-02-04 17:47:44 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize 2019-02-11 13:23:37 UTC
Pushed to 18.11.x for 18.11.03
Comment 6 Lucas Gass 2019-02-12 17:05:32 UTC
backported to 18.05.x for 18.05.09
Comment 7 Fridolin Somers 2019-02-25 09:40:37 UTC
Pushed to 17.11.x will be in v17.11.15