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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to