Bugzilla – Attachment 163231 Details for
Bug 36327
Items view - Deletion of items is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36327: Update handling of item delete
Bug-36327-Update-handling-of-item-delete.patch (text/plain), 2.48 KB, created by
Jonathan Druart
on 2024-03-15 13:01:11 UTC
(
hide
)
Description:
Bug 36327: Update handling of item delete
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-03-15 13:01:11 UTC
Size:
2.48 KB
patch
obsolete
>From 1f3871118274b384b3f740525daa20a8844a67de Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 15 Mar 2024 10:53:08 +0000 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >index bca93967f15..06fc9137e5a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -131,12 +131,13 @@ $(document).ready(function(){ > }); > } > >- $(".delete").on("click", function(e){ >+ >+ $(document).on('click', '.delete', function(e) { > e.preventDefault(); >- if ( confirmDelete(MSG_CONFIRM_DELETE_ITEM) ) { >- return $(this).siblings('form').submit(); >+ if (confirmDelete(MSG_CONFIRM_DELETE_ITEM)) { >+ return $("#" + $(this).data("item") + "-delete-item-form").submit(); > } >- }); >+ }) ; > }); > > function CheckTemplateForm(f) { >-- >2.34.1
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 36327
:
163195
|
163196
|
163197
|
163198
|
163228
|
163229
|
163230
| 163231