Bugzilla – Attachment 162337 Details for
Bug 36047
Apostrophe in suggestion status reason blocks order receipt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36047: Remove jQuery selector from conditional
Bug-36047-Remove-jQuery-selector-from-conditional.patch (text/plain), 3.60 KB, created by
Pedro Amorim
on 2024-02-22 15:46:44 UTC
(
hide
)
Description:
Bug 36047: Remove jQuery selector from conditional
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-02-22 15:46:44 UTC
Size:
3.60 KB
patch
obsolete
>From e9ee1b056701cc352799040d3269462eee160883 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 22 Feb 2024 15:42:27 +0000 >Subject: [PATCH] Bug 36047: Remove jQuery selector from conditional >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This prevents the jQuery from breaking if the reason contains an apostrophe character. > >1. Create a suggestion > 1.1. Go to Acquisitions > Suggestions > 1.2. Click New purchase suggestion > 1.3. Enter a title > 1.4. Click Submit your suggestion > >2. Update the suggestion to accepted and add a reason with an apostrophe > 2.1. In the suggestions list, check the box next to the suggestion > 2.2. At the bottom of the screen, choose Mark selected as: Accepted > 2.3. In With this reason, choose Others... > 2.4. Enter a reason with an apostrophe (my case was in French : Disponible en impression à la demande (POD). S'attendre à un long temps d'attente) > 2.5. Click Submit > >3. Order the suggestion > 3.1. Go to Acquisitions > 3.2. Search for a vendor > 3.3. Click New > Basket > 3.4. Enter a basket name > (Optional: for testing I like to change Create items when: cataloging the record) > 3.5. Click Save > 3.6. Click Add to basket > 3.7. Click From a suggestion > 3.8. Click Order next to the suggestion > 3.9. Enter order details > 3.10. Click Save > 3.11. Click Close basket > 3.12. Click Yes, close > >4. Receive the order > 4.1. Click Receive shipments > 4.2. Enter a Vendor invoice number > 4.3. Click Next > 4.4. Click Receive next to the order > --> Page stays In processing forever > >Apply patch. Repeat. Notice the page now renders correctly. >Extra: Add an entry containg an apostrophe to the SUGGEST authorized values category and repeat test plan. Confirm everything works as expected. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index eb834ea4c21..0a12ae144f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -696,7 +696,8 @@ > > if(row.biblio.suggestions.length && row.biblio.suggestions[0].reason) { > params["suggestionid"] = row.biblio.suggestions[0].suggestion_id; >- 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)) { > params['reason'] = row.biblio.suggestions[0].reason; > } else { > params['reason'] = 'other'; >@@ -1150,7 +1151,8 @@ > } > if(row.biblio.suggestions[0].reason) { > $("#suggestion_reason").show(); >- 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)) { > $("#other_reason a").click(); > $("#reason").val(row.biblio.suggestions[0].reason); > $("#select-other_reason").val(null); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36047
:
162243
|
162280
|
162281
|
162285
|
162337
|
162361