Bug 26330 - jQueryUI tabs don't work with non-Latin-1 characters
Summary: jQueryUI tabs don't work with non-Latin-1 characters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 20.05
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-01 03:20 UTC by Pablo AB
Modified: 2021-12-13 21:08 UTC (History)
7 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:
20.11.00,20.05.08
Circulation function:


Attachments
Screenshot of the issue (393.43 KB, image/jpeg)
2020-09-01 03:20 UTC, Pablo AB
Details
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints (2.69 KB, patch)
2020-09-01 12:07 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints (2.74 KB, patch)
2020-09-05 00:08 UTC, David Nind
Details | Diff | Splinter Review
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints (2.79 KB, patch)
2020-09-11 11:55 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2020-09-01 03:20:06 UTC
Created attachment 109386 [details]
Screenshot of the issue

To describe items with more detail a librarian needed more subfields on 952 tag, so after using the few available ASCII letters and numbers started using Greek letters, alpha (α), beta (β), gamma (γ)...

Then while editing any subfield, currently selected is shown and then all the other  new ones (full-page screenshot attached).

The problem seems related to the fact that under subfieldtabs id all divs but the selected should have style="display: none;". This is working only with all the ones matching [0-9a-z].
Comment 1 Owen Leonard 2020-09-01 12:07:54 UTC
Created attachment 109422 [details] [review]
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints

This patch changes the encoding of the data being used to define
jQueryUI tabs on the MARC subfield constraints page. A jQueryUI bug
prevents non-Latin-1 characters from being used when defining tab
controls. Using Template:Toolkit's "uri" filter converts the data to
usable characters.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC structure -> tag 952 -> Edit subfields.

- Under the "New" tab, add a subfield code which is outside the basic
  Latin character set, e.g. £, §, æ.
- Save changes.
- Edit any subfield code to load the subfield constraints page again.
- Test that the subfield code tabs work correctly: Clicking each tab
  should load only the corresponding panel.
- Test a variety of tabs including the one you created with the
  non-Latin character.
Comment 2 Pablo AB 2020-09-01 16:11:53 UTC
Wow that was fast! :)
One thing to note is that not any character outside the basic Latin character should be accepted, as mentioned in Bug 9874 about ampersand.
Comment 3 Owen Leonard 2020-09-04 15:48:05 UTC
(In reply to Pablo AB from comment #2)

> One thing to note is that not any character outside the basic Latin
> character should be accepted, as mentioned in Bug 9874 about ampersand.

If you have more information about how the form should be validated you could file another bug. If my patch is working for you please sign off!
Comment 4 David Nind 2020-09-05 00:08:20 UTC
Created attachment 109684 [details] [review]
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints

This patch changes the encoding of the data being used to define
jQueryUI tabs on the MARC subfield constraints page. A jQueryUI bug
prevents non-Latin-1 characters from being used when defining tab
controls. Using Template:Toolkit's "uri" filter converts the data to
usable characters.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC structure -> tag 952 -> Edit subfields.

- Under the "New" tab, add a subfield code which is outside the basic
  Latin character set, e.g. £, §, æ.
- Save changes.
- Edit any subfield code to load the subfield constraints page again.
- Test that the subfield code tabs work correctly: Clicking each tab
  should load only the corresponding panel.
- Test a variety of tabs including the one you created with the
  non-Latin character.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Julian Maurice 2020-09-11 11:55:04 UTC
Created attachment 109935 [details] [review]
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints

This patch changes the encoding of the data being used to define
jQueryUI tabs on the MARC subfield constraints page. A jQueryUI bug
prevents non-Latin-1 characters from being used when defining tab
controls. Using Template:Toolkit's "uri" filter converts the data to
usable characters.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC structure -> tag 952 -> Edit subfields.

- Under the "New" tab, add a subfield code which is outside the basic
  Latin character set, e.g. £, §, æ.
- Save changes.
- Edit any subfield code to load the subfield constraints page again.
- Test that the subfield code tabs work correctly: Clicking each tab
  should load only the corresponding panel.
- Test a variety of tabs including the one you created with the
  non-Latin character.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Jonathan Druart 2020-09-29 12:31:49 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass (lukeg) 2020-10-20 17:18:08 UTC
enhancement will not be backported to 20.05.x
Comment 8 Andrew Fuerste-Henry 2021-01-13 22:22:36 UTC
I went ahead and backported this to 20.05.x for 20.05.08
Comment 9 Victor Grousset/tuxayo 2021-01-21 23:15:23 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.