[Bug 42116] New: e.preventDefault is a function, needs parenthesis
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Bug ID: 42116 Summary: e.preventDefault is a function, needs parenthesis Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: ephetteplace@cca.edu QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com I noticed that a few places in the codebase e.preventDefault is simply stated as an expression and not called, but preventDefault is a method and must be called to have any effect.
rg "\.preventDefault;" koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt 176: e.preventDefault;
koha-tmpl/intranet-tmpl/prog/js/holds.js 750: e.preventDefault; koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js 79: e.preventDefault; 96: e.preventDefault; This might not be a trivial change because it could alter UI behavior. Bug 42012 fixes clubs.tt. -- 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=42116 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42012 -- 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=42116 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|e.preventDefault is a |e.preventDefault is a |function, needs parenthesis |function, needs parentheses -- 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=42116 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #1 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 198690 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198690&action=edit Bug 42116: e.preventDefault is a function, needs parentheses This change is unnoticeable in the UI, so the patch does not need before/after testing, but assurance that everything works. The affected code is used in 3 places for holds (cancelling a hold from reserve/request.pl, circ/circulation.pl, and members/moremember.pl) and 2 for cataloging (two different functions on cataloguing/additem.pl). For holds: 1. Create three holds on different bibs for a patron 2. On the same page where you create the last hold (reserve/request.pl), delete it 3. Circulation > Check out (circ/circulation.pl) > Check out a different title to patron 4. Switch to patron's Holds tab, delete a hold 5. Go to Patrons account (members/moremember.pl) > Holds tab, delete a hold 6. All holds should delete successfully For cataloging: 1. Go to any bib > New > New item 2. Select "Add Multiple Copies of this Item", add a note 3. Confirm multiple items are created with the note 4. Enter a new note, then select "Save as template" 5. Confirm the item template exists & create an item using it -- 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=42116 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=42116 --- Comment #2 from Eric Phetteplace <ephetteplace@cca.edu> --- Another solid test: afterwards `rg "e.preventDefault;"` shouldn't find any files with that exact string in them. (rg here is ripgrep) -- 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=42116 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Nice catch. Adding this to my TODO list for review although at a glance it makes sense. -- 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=42116 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Assignee|koha-bugs@lists.koha-commun |ephetteplace@cca.edu |ity.org | --- Comment #4 from David Nind <david@davidnind.com> --- Added assignee 8-). -- 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=42116 --- Comment #5 from David Nind <david@davidnind.com> --- For step 3 (for holds), deleting a hold from the holds tab under [Patron account] > Check out > Holds, does not delete the hold. There are two holds, clicking the delete icon for a hold (the last one), does not actually delete it. That is, there are still two holds. If you switch between the Holds and Check out sections, it shows 2 holds. This is the same before and after the patch, so another bug somewhere. As there is no change before and after the patch, let me know if this is OK for sign off. Let me know if you want the exact steps I followed. Everything else continues to work the same before and after the patch. git grep shows four entries before and none after the patch: git grep -n "e.preventDefault;" koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js:79: e.preventDefault; koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js:96: e.preventDefault; koha-tmpl/intranet-tmpl/prog/js/holds.js:757: e.preventDefault; koha-tmpl/intranet-tmpl/prog/js/holds.js:2019: e.preventDefault; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #6 from Eric Phetteplace <ephetteplace@cca.edu> --- Interesting. It took me so long to recreate the issue, because it doesn't just happen if you go to /circ/circulation.pl?borrowernumber=X you specifically have to check something out first, then the hold does not delete. If you go to patron > holds tab, it deletes, and if you go to circ > check out > find a patron > instead of checking out, go to the holds tab, it also deletes. But circ > check out > find patron > check out a title > delete a hold does not delete. Yes I would appreciate the sign off and I will open a new bug for the other behavior. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42724 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community |https://bugs.koha-community |.org/bugzilla3/show_bug.cgi |.org/bugzilla3/show_bug.cgi |?id=42724 |?id=41825 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #7 from Eric Phetteplace <ephetteplace@cca.edu> --- Ah Bug 41825 already existed for the "can't cancel hold after checkout" bug and has a patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198690|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 199727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199727&action=edit Bug 42116: e.preventDefault is a function, needs parentheses This change is unnoticeable in the UI, so the patch does not need before/after testing, but assurance that everything works. The affected code is used in 3 places for holds (cancelling a hold from reserve/request.pl, circ/circulation.pl, and members/moremember.pl) and 2 for cataloging (two different functions on cataloguing/additem.pl). For holds: 1. Create three holds on different bibs for a patron 2. On the same page where you create the last hold (reserve/request.pl), delete it 3. Circulation > Check out (circ/circulation.pl) > Check out a different title to patron 4. Switch to patron's Holds tab, delete a hold 5. Go to Patrons account (members/moremember.pl) > Holds tab, delete a hold 6. All holds should delete successfully For cataloging: 1. Go to any bib > New > New item 2. Select "Add Multiple Copies of this Item", add a note 3. Confirm multiple items are created with the note 4. Enter a new note, then select "Save as template" 5. Confirm the item template exists & create an item using it Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199727|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200752&action=edit Bug 42116: e.preventDefault is a function, needs parentheses This change is unnoticeable in the UI, so the patch does not need before/after testing, but assurance that everything works. The affected code is used in 3 places for holds (cancelling a hold from reserve/request.pl, circ/circulation.pl, and members/moremember.pl) and 2 for cataloging (two different functions on cataloguing/additem.pl). For holds: 1. Create three holds on different bibs for a patron 2. On the same page where you create the last hold (reserve/request.pl), delete it 3. Circulation > Check out (circ/circulation.pl) > Check out a different title to patron 4. Switch to patron's Holds tab, delete a hold 5. Go to Patrons account (members/moremember.pl) > Holds tab, delete a hold 6. All holds should delete successfully For cataloging: 1. Go to any bib > New > New item 2. Select "Add Multiple Copies of this Item", add a note 3. Confirm multiple items are created with the note 4. Enter a new note, then select "Save as template" 5. Confirm the item template exists & create an item using it Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42116 --- Comment #10 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org