Summary: | Add missing DBIx::Class relationships - biblio<->biblioitem<->item | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, kyle.m.hall, kyle |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14544 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 14818 | ||
Attachments: |
Bug 14819: Add missing DBIx::Class relationships - biblio<->biblioitem<->item
[SIGNED-OFF] Bug 14819: Add missing DBIx::Class relationships - biblio<->biblioitem<->item |
Description
Jonathan Druart
2015-09-14 16:05:32 UTC
Created attachment 42531 [details] [review] Bug 14819: Add missing DBIx::Class relationships - biblio<->biblioitem<->item To access the biblio from an item, we should not use the biblioitemnumber relationship autogenerated by DBIx::Class::Schema::Loader but create our own one. Test plan: Confirm the tests pass and that there is no regression on bug 14726. Koha::Item::biblioitem appears to return a DBIC object. Can you create Koha::Biblioitem and use the _wrap method so it can return a Koha::Biblioitem object? Created attachment 44093 [details] [review] [SIGNED-OFF] Bug 14819: Add missing DBIx::Class relationships - biblio<->biblioitem<->item To access the biblio from an item, we should not use the biblioitemnumber relationship autogenerated by DBIx::Class::Schema::Loader but create our own one. Test plan: Confirm the tests pass and that there is no regression on bug 14726. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, no regressions, no errors Koha::Item::biblioitem should return a Koha::Biblioitem object, rather than a DBIC object. Another possibility would be to extend Koha::Biblio so that it handles both the biblio and biblioitem tables internally, so they look like one unified table from the perspective using using Koha::Biblio. The auto method on Koha::Biblio could be extended to check for a valid biblio field first, and if it doesn't find one, a valid biblioitem field. |