https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43930 Bug ID: 43930 Summary: Restoring a deleted item to an existing biblio causes an error if its biblioitemnumber no longer exists Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- To recreate: 1. Have a record w items. In KTD I am using biblionumber 233. ( 3 items with itemnumbers 515, 516, 517 ) 2. Have a record without items, in KTD I am using biblionumber 234 ( 0 items ) 3. Set one items biblioitemnumber to the biblionumber of record 234: UPDATE items SET biblioitemnumber = 234 WHERE itemnumber = 515; 4. Confirm these are now mismatched: SELECT itemnumber, biblionumber, biblioitemnumber FROM items WHERE itemnumber = 515; +------------+--------------+------------------+ | itemnumber | biblionumber | biblioitemnumber | +------------+--------------+------------------+ | 515 | 233 | 234 | +------------+--------------+------------------+ 5. From the staff interface delete item 515 from biblio 234. 6. From the staff interface delete biblionumber 234 7. Try to restore item 515, just the item not the bib 8. Error restoring item 515: Something went wrong, check Koha logs for details: [2026/10/28 17:22:54] [WARN] Broken FK constraint at /kohadevbox/koha/Koha/Object.pm line 176. [2026/10/28 17:22:54] [ERROR] PUT /api/v1/deleted/items/515: unhandled exception (Koha::Exceptions::Object::FKConstraint)<<Broken FK constraint>> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.