[Bug 43665] New: Fix HTML entities in fields filled by marc21_linking_section.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43665 Bug ID: 43665 Summary: Fix HTML entities in fields filled by marc21_linking_section.pl Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: MARC Bibliographic data support Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Hello, When selecting a record with the marc21_linking_section.pl plugin, values copied into the linking field (773$t, $a, $b, $d, $k...) show literal HTML entities (&, ", ') whenever the source record contains special characters. The values were written in a JavaScript string with the "html" filter. The browser does not decode entities inside a <script> block, so they ended up as text in the subfield. The plugin also escaped ' as \' in Perl, which made the output worse. This became visible with bug 29733, which copies many more subfields from the source record. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43665 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29733 Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43665 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.co |ity.org |m -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43665 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |BibLibre list of Sponsors| | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43665 --- Comment #1 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 206954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206954&action=edit Bug 43665: Pass the values in a single hash, expose them as data-* attributes on a hidden element (where the "html" filter is correct, the browser decodes entities) and read them with dataset in the script. This also replaces 19 repeated "if (code.value == 'x')" blocks. Test plan: 1. In a MARC21 bibliographic framework, link 773$t to the plugin marc21_linking_section.pl. 2. Create a bibliographic record (the host record) with: 100 $a Doe, John 245 $a Tom & Jerry : "the best" episodes </script> 250 $a 2nd ed. "revised & corrected" 260 $a London : $b Smith's Books & Co, $c 2020 3. Create a second record (the analytical record) and open the plugin from 773$t. 4. Search "Jerry" and click "Choose" on the host record. 5. Without the patch: 773$t, $b, $d and $k show literal & " and ' instead of & " and '. With the patch: the values are shown exactly as in the host record and the popup closes normally, even with </script> in the title. 6. Create a record with 245 ind1=1 ind2=4 and 245 $a The Beatles & co. : "greatest" hits Repeat steps 3 and 4 with the search "Beatles". 773$t must be: Beatles & co. : "greatest" hits 7. Sign off. Sponsored-by: BibLibre -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org