Bug 40859 - Item deletion is broken when using the linktools button
Summary: Item deletion is broken when using the linktools button
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Testopia
URL:
Keywords:
Depends on: 37115
Blocks:
  Show dependency treegraph
 
Reported: 2025-09-23 10:25 UTC by Matt Blenkinsop
Modified: 2025-09-25 12:52 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40859: Restore deletion when using the 'linktools' button (1.33 KB, patch)
2025-09-23 10:28 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40859: (QA follow-up) Remove unnecessary alert (1.84 KB, patch)
2025-09-23 15:36 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2025-09-23 10:25:41 UTC
Comment from bug 37116

Go to:
http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=1&itemnumber=1

click on the row, then "Delete item"
You see an alert: "Are you sure you want to delete this item?"
Click "OK"
You then see the modal "Are you sure you want to delete this item?"
Click "Delete item"

=> Nothing happens!
Comment 1 Matt Blenkinsop 2025-09-23 10:28:04 UTC
Created attachment 186783 [details] [review]
Bug 40859: Restore deletion when using the 'linktools' button

Test plan:
1) Go to:
http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=1&itemnumber=1
2) Click on the row for the first item to get the linktool buttons
3) Click "Delete item"
4) Accept the "Are you sure you want to delete this item?" alert
5) Accept the modal
6) The page refreshes and the item is deleted
Comment 2 Jonathan Druart 2025-09-23 11:03:27 UTC
We don't need both confirmation. We should remove the alert (was it the behaviour before bug 37115?)
Comment 3 Matt Blenkinsop 2025-09-23 15:36:43 UTC
Created attachment 186823 [details] [review]
Bug 40859: (QA follow-up) Remove unnecessary alert
Comment 4 Jonathan Druart 2025-09-25 12:49:34 UTC
I am not sure this is directly caused by this patch or the precedent change, but I was suspecting the ".delete" to be too wide, and I caught this:

140                                                     [%# Host item %]
141                                                     <li
142                                                         ><a href="additem.pl?op=edititem&amp;biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#edititem">Edit in host</a> &nb    sp;
143                                                         <a
144                                                             class="delete"
145                                                             href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblio.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | ht    ml %]&amp;searchid=[% searchid | html %]"
146                                                             >Unlink</a
147                                                         ></li
148                                                     >

The UI is broken:
https://snipboard.io/l3bdgu.jpg

And "Unlink" opens the modal. "Delete the item" does not work, but actually I don't think it should delete the item.
Comment 5 Jonathan Druart 2025-09-25 12:52:59 UTC
(In reply to Jonathan Druart from comment #4)
> I am not sure this is directly caused by this patch or the precedent change,
> but I was suspecting the ".delete" to be too wide

Seems to be an existing bug.