k-t-d 1) visit a biblio details view: http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=230 2) Click anywhere on one of the items rows 3) Notice 2 actions show up "Edit item" and "Delete item" 4) Click "delete item" 5) Notice nothing happens in the UI 6) Notice console throws the following error: cataloging_additem_23.1200007.js:29 Uncaught ReferenceError: confirm_deletion is not defined at HTMLAnchorElement.<anonymous> (cataloging_additem_23.1200007.js:29:17) at HTMLAnchorElement.dispatch (jquery-3.6.0.min_23.1200007.js:2:43064) at v.handle (jquery-3.6.0.min_23.1200007.js:2:41048)
Created attachment 163195 [details] [review] Bug 36327: Preparation: Update form Each delete form now contains the itemnumber to better unambiguosly identify the the itemnumber it refers to The delete button now carries the itemnumber it refers to
Created attachment 163196 [details] [review] Bug 36327: Clean-up old unused code that results in error
Created attachment 163197 [details] [review] Bug 36327: Delete link is no longer a GET href
Created attachment 163198 [details] [review] Bug 36327: Update handling of item delete This needs to be rewritten to .on('click') because the delete item link relevant to this patchset is appended to the dom, this is how we guarantee this event listener is attached to the appended link. This also ensures the same item deletion logic is applied for both button: The delete button from the left 'Actions' dropdown and the 'Delete item' link that pops up when anywhere in the row is clicked 1) visit a biblio details view: http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=230 2) Click anywhere on one of the items rows 3) Notice 2 actions show up "Edit item" and "Delete item" 4) Click "delete item" 5) Notice nothing happens in the UI 6) Notice console throws the following error: cataloging_additem_23.1200007.js:29 Uncaught ReferenceError: confirm_deletion is not defined at HTMLAnchorElement.<anonymous> (cataloging_additem_23.1200007.js:29:17) at HTMLAnchorElement.dispatch (jquery-3.6.0.min_23.1200007.js:2:43064) at v.handle (jquery-3.6.0.min_23.1200007.js:2:41048) 7) Apply patches 8) Notice console error no longer shows 9) Notice delete confirmation is shown, notice clicking it deletes the correct item. 10) Notice the delete item link anywhere in the item row has the same behavior as the 'Delete' option under 'Actions' on the leftmost column of the table
Created attachment 163228 [details] [review] Bug 36327: Preparation: Update form Each delete form now contains the itemnumber to better unambiguosly identify the the itemnumber it refers to The delete button now carries the itemnumber it refers to Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 163229 [details] [review] Bug 36327: Clean-up old unused code that results in error Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 163230 [details] [review] Bug 36327: Delete link is no longer a GET href Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 163231 [details] [review] Bug 36327: Update handling of item delete This needs to be rewritten to .on('click') because the delete item link relevant to this patchset is appended to the dom, this is how we guarantee this event listener is attached to the appended link. This also ensures the same item deletion logic is applied for both button: The delete button from the left 'Actions' dropdown and the 'Delete item' link that pops up when anywhere in the row is clicked 1) visit a biblio details view: http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=230 2) Click anywhere on one of the items rows 3) Notice 2 actions show up "Edit item" and "Delete item" 4) Click "delete item" 5) Notice nothing happens in the UI 6) Notice console throws the following error: cataloging_additem_23.1200007.js:29 Uncaught ReferenceError: confirm_deletion is not defined at HTMLAnchorElement.<anonymous> (cataloging_additem_23.1200007.js:29:17) at HTMLAnchorElement.dispatch (jquery-3.6.0.min_23.1200007.js:2:43064) at v.handle (jquery-3.6.0.min_23.1200007.js:2:41048) 7) Apply patches 8) Notice console error no longer shows 9) Notice delete confirmation is shown, notice clicking it deletes the correct item. 10) Notice the delete item link anywhere in the item row has the same behavior as the 'Delete' option under 'Actions' on the leftmost column of the table Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
There are some new and some pre-existing translatability issues with this one, I filed a separate bug: Bug 36377 - Fix translatability issues in koha-backend.js
Pushed for 24.05! Well done everyone, thank you!
Does this depend on Bug 34478 ?
(In reply to Fridolin Somers from comment #11) > Does this depend on Bug 34478 ? I set this as blocking bug 36192 to relate to the CSRF. I'm unsure and confused as what it should be, block bug 36192 or depend on bug 34478?
I dont reproduce on 23.11.x so surely depend on bug 34478 I dont backport