Koha-clms/Koha/REST/V1
Olli Kautonen 9445ffc9aa
Bug 40154: prevent deletion of items with holds
This patch prevents deletion of items that have item level holds on
them.

Test plan:
1. Create an item level hold.
2. Delete the item using alternative A or B:
   A. Open the biblios Detail-view -> From the toolbar, open
      "Edit"-dropdown menu -> Manage items -> Delete the item that has
      an item level hold attached to it from "Actions"-dropdown menu
   B. Open the biblios Detail-view -> Select the item that has an item
      level hold attached to it -> Click "Delete selected items" ->
      Confirm deletion
3. Notice that the item is deleted without any warning and the item
   level hold has disappeared.
4. Apply this patch.
5. Repeat steps 1-3.
6. Notice that the item cannot be deleted and a warning is shown.
7. prove t/db_dependent/Koha/Item.t
8. Run the REST API tests: prove t/db_dependent/api/v1/items.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-10 10:52:04 -07:00
..
Acquisitions Bug 29668: Adapt to current guidelines 2026-01-21 15:28:16 -07:00
Auth Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Biblios Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
CashRegisters Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Clubs Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Config Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
ERM Bug 40192: Add additional fields support to ERM titles 2026-01-22 09:25:57 -07:00
ILL Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
OAuth Bug 34164: Redirect to referring URL when doing OIDC/OAuth SSO 2025-10-09 14:58:40 -06:00
Patrons Bug 40613: Add DELETE hold groups REST API endpoint 2025-11-07 10:54:15 -07:00
Preservation Bug 37622: Remove location from 2 preservation 'update' routes 2025-09-26 10:36:53 -06:00
SIP2 Bug 37893: Fix http links 2025-11-18 11:21:20 -07:00
StockRotation Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
AdditionalContents.pm Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
AdvancedEditorMacro.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ArticleRequests.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Auth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
AuthorisedValueCategories.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
AuthorisedValues.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Authorities.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
BackgroundJobs.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Biblios.pm Bug 39336: Public Biblio endpoint should honour OpacSuppression syspref 2025-10-24 07:57:00 -06:00
Bookings.pm Bug 40134: Implement optimal item selection for 'any item' bookings 2026-02-10 08:50:56 -07:00
Checkouts.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
CirculationRules.pm Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Cities.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
DeletedBiblios.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ERM.pm Bug 39320: Preparation: ERM counts API endpoint 2026-01-13 15:03:20 -07:00
ExtendedAttributeTypes.pm Bug 39438: (bug 38446 follow-up) Add agreement_period to /erm/extended_attribute_types 2026-01-30 10:54:11 -07:00
Holds.pm Bug 41416: Add skip_fix_priority option to ModReserve 2026-01-16 14:07:18 -07:00
ImportBatchProfiles.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ImportRecordMatches.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ItemTypes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Items.pm Bug 40154: prevent deletion of items with holds 2026-02-10 10:52:04 -07:00
Libraries.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Lists.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
OAuth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Patrons.pm Bug 40219: Moved Extended Attributes Validation Before Enqueuing Welcome Email 2025-12-17 13:24:34 -07:00
Preservation.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Quotes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
RecordSources.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ReturnClaims.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
SearchFilter.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Static.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Suggestions.pm Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Tickets.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TransferLimits.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TwoFactorAuth.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00