[Koha-bugs] [Bug 36047] Apostrophe in suggestion status reason blocks order receipt

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 22 16:16:48 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36047

Julian Maurice <julian.maurice at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maurice at biblibre.com

--- Comment #7 from Julian Maurice <julian.maurice at biblibre.com> ---
With the patch applied, if the reason selected is one from the SUGGEST
authorised value category, and this reason has an apostrophe, on the receive
modal the reason is displayed inside a text input, instead of the select.
I think it's due to the fact that the selector
`option[value="l'apostrophe"]` will not match <option
value="l'apostrophe">. A properly escaped selector would be
`option[value="l\'apostrophe"]`

We should do something like this instead:

-    if($("#reason
option[value='"+row.biblio.suggestions[0].reason+"']").length) {
+    const options = Array.from(document.querySelectorAll('#reason option'))
+    if (options.some(option => option.value ===
row.biblio.suggestions[0].reason)) {

No need to escape anything

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list