https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42934 Bug ID: 42934 Summary: Koha::Item->home_library/holding_library croak when an item's branch is NULL Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: paul.derscheid@lmscloud.de QA Contact: testopia@bugs.koha-community.org Target Milestone: --- items.homebranch and items.holdingbranch are nullable. When either is NULL, Koha::Item->home_library / ->holding_library croak with: DBIC result _type isn't of the _type Branch Impact: a 500 on GET /api/v1/biblios/{biblio_id}/items, so the catalogue detail items table fails to load for the whole record if any one of its items has a NULL home or holding branch. The NULL state is not reachable through normal item creation/editing (those always set the columns), only via out-of-band data such as an SQL import or migration, which Koha already flags as a data inconsistency (Koha::Database::DataInconsistency::invalid_item_library). To reproduce: 1. UPDATE items SET holdingbranch = NULL WHERE itemnumber = <X>; 2. Open that record's detail page in the staff interface. => the holdings table fails to load; the plack log shows the croak above. Expected: the item row loads, with an empty home/holding library. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.