[Bug 14651] New: Koha::Item::effective_itemtype should fallback to biblio-level if no item-level itemtype
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Bug ID: 14651 Summary: Koha::Item::effective_itemtype should fallback to biblio-level if no item-level itemtype Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org I fill this bug to start a conversation about this issue. It seems the codebase has several ways of determining the itemtype. For example, C4::Circulation::AddReturn used the biblio-level itemtype (until bug 14598) and C4::Circulation::CanBookBeIssued just sticks to item-level itemtype. At first sight, it seems clear to me that we should start moving into using Koha::Item objects, that even provide an ->effective_itemtype method! Having talked about this on IRC there seems to be a consensus that if the item doesn't have an itemtype, then there should be a fallback to biblio-level itemtype. This means we should add that check to the ->effective_itemtype method. But it would mean including Koha::Biblios. Thoughts? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 41635 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41635&action=edit Bug 14651: (regression test) fallback to bib-level if itype is undef Koha::Item->effective_itemtype should fallback to biblio-level itemtype even if item-level item types are set, in the case the item has no itemtype set (bad migration, bad old code). To test: - Run $ prove t/db_dependent/Items.t => FAIL: Koha::Item->effective_itemtype doesn't work properly -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 41636 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41636&action=edit Bug 14651: Koha::Item->effective_itemtype fallback to bib-level In some situations (bad migrations, old bugs that introduced bad data, people having bib-level itypes for ages and switching to item level...) the user ends with undex itype values for items. The current code, if the user has item_level-itype set, just returns undef. It should fallback to bib-level. To test: - Run the regression tets: $ prove t/db_dependent/Items.t => FAIL: tests fail. - Apply the patch - Run the tests again => SUCCESS: The tests now pass. - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14598 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14598 [Bug 14598] itemtype is not set on statistics by C4::Circulation::AddReturn -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Small patch Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #0)
At first sight, it seems clear to me that we should start moving into using Koha::Item objects, that even provide an ->effective_itemtype method!
Having talked about this on IRC there seems to be a consensus that if the item doesn't have an itemtype, then there should be a fallback to biblio-level itemtype.
This means we should add that check to the ->effective_itemtype method. But it would mean including Koha::Biblios.
The patches work fine, but aren't we masquerading a problem that should be addressed instead of hidden ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41635|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42083 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42083&action=edit Bug 14651: (regression test) fallback to bib-level if itype is undef Koha::Item->effective_itemtype should fallback to biblio-level itemtype even if item-level item types are set, in the case the item has no itemtype set (bad migration, bad old code). To test: - Run $ prove t/db_dependent/Items.t => FAIL: Koha::Item->effective_itemtype doesn't work properly Edit: Added a test for a warning when falling back as per QA request and because it made a lot of sense :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41636|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42084 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42084&action=edit Bug 14651: Koha::Item->effective_itemtype fallback to bib-level In some situations (bad migrations, old bugs that introduced bad data, people having bib-level itypes for ages and switching to item level...) the user ends with undex itype values for items. The current code, if the user has item_level-itype set, just returns undef. It should fallback to bib-level. In order to avoid hiding the problem a warning is raised. To test: - Run the regression tets: $ prove t/db_dependent/Items.t => FAIL: tests fail. - Apply the patch - Run the tests again => SUCCESS: The tests now pass. - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42083|0 |1 is obsolete| | --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 42264 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42264&action=edit Bug 14651: (regression test) fallback to bib-level if itype is undef Koha::Item->effective_itemtype should fallback to biblio-level itemtype even if item-level item types are set, in the case the item has no itemtype set (bad migration, bad old code). To test: - Run $ prove t/db_dependent/Items.t => FAIL: Koha::Item->effective_itemtype doesn't work properly Edit: Added a test for a warning when falling back as per QA request and because it made a lot of sense :-D Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42084|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 42265 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42265&action=edit Bug 14651: Koha::Item->effective_itemtype fallback to bib-level In some situations (bad migrations, old bugs that introduced bad data, people having bib-level itypes for ages and switching to item level...) the user ends with undex itype values for items. The current code, if the user has item_level-itype set, just returns undef. It should fallback to bib-level. In order to avoid hiding the problem a warning is raised. To test: - Run the regression tets: $ prove t/db_dependent/Items.t => FAIL: tests fail. - Apply the patch - Run the tests again => SUCCESS: The tests now pass. - Sign off :-D Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42264|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 42270 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42270&action=edit Bug 14651: (regression test) fallback to bib-level if itype is undef Koha::Item->effective_itemtype should fallback to biblio-level itemtype even if item-level item types are set, in the case the item has no itemtype set (bad migration, bad old code). To test: - Run $ prove t/db_dependent/Items.t => FAIL: Koha::Item->effective_itemtype doesn't work properly Edit: Added a test for a warning when falling back as per QA request and because it made a lot of sense :-D Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42265|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 42271 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42271&action=edit Bug 14651: Koha::Item->effective_itemtype fallback to bib-level In some situations (bad migrations, old bugs that introduced bad data, people having bib-level itypes for ages and switching to item level...) the user ends with undex itype values for items. The current code, if the user has item_level-itype set, just returns undef. It should fallback to bib-level. In order to avoid hiding the problem a warning is raised. To test: - Run the regression tets: $ prove t/db_dependent/Items.t => FAIL: tests fail. - Apply the patch - Run the tests again => SUCCESS: The tests now pass. - Sign off :-D Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|14598 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14598 [Bug 14598] itemtype is not set on statistics by C4::Circulation::AddReturn -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14651 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org