[Bug 30636] New: ILS-DI shows incorrect availability when Notforloan by Itemtype
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Bug ID: 30636 Summary: ILS-DI shows incorrect availability when Notforloan by Itemtype Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Web services Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org If you've marked an item type as "Not for loan" in Koha, it'll show a "Status" of "Not for loan" in the catalogue, but the ILS-DI GetAvailability service will advertise it as still available. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Unfortunately, detail.tt uses item.notforloan_per_itemtype which is a column alias from a custom SQL query in C4/Items.pm. In theory, we could just add a Koha::Item->notforloan_per_itemtype method, but then it seems like Koha::Item->notforloan is often used as a boolean to determine if an item is not for loan... and sometimes Koha::Item->notforloan is used for its particular "Not for loan" description. It seems to me that we might be better off creating a new method like Koha::Item->is_not_for_loan() which returns a boolean response based on the "notforloan" value and whether it's "Not for loan" based on its item type. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 134200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134200&action=edit Bug 30636: Show notforloan availability correctly in ILS-DI This patch adds the Koha::Item->is_notforloan() method which checks the item status of "notforloan" and it checks the effective item type to see if it's marked as "notforloan". This change brings ILS-DI in line with the catalogue which displays "Not for loan" for both those scenarios. 0. Don't apply patch yet 1. Enable ILS-DI system preference http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI 2. Change Item types to "Not for Loan" for Books http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK 3. Note that book is listed as "Not for loan" in catalogue http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29&searchid=scs_1651115075364 4. Note that book is listed as "available" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib 5. Apply patch and restart starman (ie koha-plack --restart kohadev) 6. Note that book is listed as "not available" and "Not for loan" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib -- 7. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134200|0 |1 is obsolete| | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 134201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134201&action=edit Bug 30636: Show notforloan availability correctly in ILS-DI This patch adds the Koha::Item->is_notforloan() method which checks the item status of "notforloan" and it checks the effective item type to see if it's marked as "notforloan". This change brings ILS-DI in line with the catalogue which displays "Not for loan" for both those scenarios. 0. Don't apply patch yet 1. Enable ILS-DI system preference http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI 2. Change Item types to "Not for Loan" for Books http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK 3. Note that book is listed as "Not for loan" in catalogue http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29&searchid=scs_1651115075364 4. Note that book is listed as "available" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib 5. Apply patch and restart starman (ie koha-plack --restart kohadev) 6. Note that book is listed as "not available" and "Not for loan" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib -- 7. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134201|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 134566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134566&action=edit Bug 30636: Show notforloan availability correctly in ILS-DI This patch adds the Koha::Item->is_notforloan() method which checks the item status of "notforloan" and it checks the effective item type to see if it's marked as "notforloan". This change brings ILS-DI in line with the catalogue which displays "Not for loan" for both those scenarios. 0. Don't apply patch yet 1. Enable ILS-DI system preference http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI 2. Change Item types to "Not for Loan" for Books http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK 3. Note that book is listed as "Not for loan" in catalogue http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29&searchid=scs_1651115075364 4. Note that book is listed as "available" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib 5. Apply patch and restart starman (ie koha-plack --restart kohadev) 6. Note that book is listed as "not available" and "Not for loan" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib -- 7. prove t/db_dependent/Koha/Item.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the ILS-DI web release notes| |service so that requests | |where item types are not | |for loan are correctly | |returned, the same as for | |the OPAC. Currently, the | |item not for loan status is | |ignored and records are | |shown as available. CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Looking here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I believe the new is_notforloan is not complete as is: * You check for the notforloan status in the item * You check for the notforloan of the itemtype of the item But: I think you need to use effective_itemtype here to catch itemtype on record level as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #6)
I believe the new is_notforloan is not complete as is:
* You check for the notforloan status in the item * You check for the notforloan of the itemtype of the item
But: I think you need to use effective_itemtype here to catch itemtype on record level as well.
Nope. That's automagically handled by '$self->itemtype;'. See below: =head3 itemtype my $itemtype = $item->itemtype; Returns Koha object for effective itemtype =cut sub itemtype { my ( $self ) = @_; return Koha::ItemTypes->find( $self->effective_itemtype ); } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #7)
(In reply to Katrin Fischer from comment #6)
I believe the new is_notforloan is not complete as is:
* You check for the notforloan status in the item * You check for the notforloan of the itemtype of the item
But: I think you need to use effective_itemtype here to catch itemtype on record level as well.
Nope. That's automagically handled by '$self->itemtype;'. See below:
=head3 itemtype
my $itemtype = $item->itemtype;
Returns Koha object for effective itemtype
=cut
sub itemtype { my ( $self ) = @_; return Koha::ItemTypes->find( $self->effective_itemtype ); }
Ah, I was looking for this, but still missed it. Thx for clarifying! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134566|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 135729 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135729&action=edit Bug 30636: Show notforloan availability correctly in ILS-DI This patch adds the Koha::Item->is_notforloan() method which checks the item status of "notforloan" and it checks the effective item type to see if it's marked as "notforloan". This change brings ILS-DI in line with the catalogue which displays "Not for loan" for both those scenarios. 0. Don't apply patch yet 1. Enable ILS-DI system preference http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI 2. Change Item types to "Not for Loan" for Books http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK 3. Note that book is listed as "Not for loan" in catalogue http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29&searchid=scs_1651115075364 4. Note that book is listed as "available" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib 5. Apply patch and restart starman (ie koha-plack --restart kohadev) 6. Note that book is listed as "not available" and "Not for loan" via ILS-DI http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=29&id_type=bib -- 7. prove t/db_dependent/Koha/Item.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ILS-DI shows incorrect |ILS-DI shows incorrect |availability when |availability when not for |Notforloan by Itemtype |loan by item type -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30913 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org