[Bug 28169] New: Text value of holdallowed rendered without quotes in JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Bug ID: 28169 Summary: Text value of holdallowed rendered without quotes in JS Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Circulation Assignee: nugged@gmail.com Reporter: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, joonas.kylmala@helsinki.fi, kyle.m.hall@gmail.com, stalkernoid@gmail.com Depends on: 27069 There is code in request.tt: homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]", holdallowed: [% itemloo.holdallowed | html %] which earlier rendered itemloo.holdallowed ony digits for itemloo.holdallowed but now it has string, for example 'from_any_library', so it should be in quotes now. To reproduce the problem: 1. Add circulation rules which allow 1 hold to the itemtype 2. Make 1 hold to patron 3. Make sure AllowHoldPolicyOverride syspref enabled 4. Make hold waiting and click revert button, you should see now JS error I am providing a fix today. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 [Bug 27069] Change holdallowed values from numbers to strings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Circulation |Hold requests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Text value of holdallowed |Reverting waiting hold |rendered without quotes in |causes holds page |JS |Javascript stop functioning -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 --- Comment #1 from Andrew Nugged <nugged@gmail.com> --- Created attachment 119853 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119853&action=edit Bug 28169: Add quotes around value in template to render proper JS There is code in request.tt: homebranch: "[% ... %]", holdallowed: [% ... %] There only digits where expected earlier in holdallowed but now it can be string value ('from_any_library' for example), so it should be in quotes. To reproduce the problem: 1. Add circulation rules which allow 1 hold only to the itemtype 2. Make sure AllowHoldPolicyOverride syspref enabled 3. Make 1 hold to patron for any biblio which has a few items available, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 (this biblio record has 4 items) 4. Start another hold for same patron on any biblio record or the same, and keep browser's JS console open, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 5. You should see now JS error in browser console: Uncaught ReferenceError: from_any_library is not defined Uncaught ReferenceError: columns_settings_borrowers_table is not defined 6. Apply the patch 7. Repeat the steps 4-5 (reload the page) and now the JS error should be gone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119853|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 119917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119917&action=edit Bug 28169: Add quotes around value in template to render proper JS There is code in request.tt: homebranch: "[% ... %]", holdallowed: [% ... %] There only digits where expected earlier in holdallowed but now it can be string value ('from_any_library' for example), so it should be in quotes. To reproduce the problem: 1. Add circulation rules which allow 1 hold only to the itemtype 2. Make sure AllowHoldPolicyOverride syspref enabled 3. Make 1 hold to patron for any biblio which has a few items available, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 (this biblio record has 4 items) 4. Start another hold for same patron on any biblio record or the same, and keep browser's JS console open, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 5. You should see now JS error in browser console: Uncaught ReferenceError: from_any_library is not defined Uncaught ReferenceError: columns_settings_borrowers_table is not defined 6. Apply the patch 7. Repeat the steps 4-5 (reload the page) and now the JS error should be gone Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119917|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 120235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120235&action=edit Bug 28169: Add quotes around value in template to render proper JS There is code in request.tt: homebranch: "[% ... %]", holdallowed: [% ... %] There only digits where expected earlier in holdallowed but now it can be string value ('from_any_library' for example), so it should be in quotes. To reproduce the problem: 1. Add circulation rules which allow 1 hold only to the itemtype 2. Make sure AllowHoldPolicyOverride syspref enabled 3. Make 1 hold to patron for any biblio which has a few items available, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 (this biblio record has 4 items) 4. Start another hold for same patron on any biblio record or the same, and keep browser's JS console open, for example on "reset_all dev db set": /cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=1 5. You should see now JS error in browser console: Uncaught ReferenceError: from_any_library is not defined Uncaught ReferenceError: columns_settings_borrowers_table is not defined 6. Apply the patch 7. Repeat the steps 4-5 (reload the page) and now the JS error should be gone Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice catch, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 27069 not in 20.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org