Created attachment 70384 [details] [review] Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued Just a preliminary step to clean the code a bit in CanBookBeIssued. The effective item type is already set from GetItem and we do not need to deal with that again.
Created attachment 70385 [details] [review] Bug 19943: Koha::GetBiblioItemData - Replace existing occurrences The biblioitem's info can be retrieved with Koha::Biblio->biblioitem Test plan: 1. Use the age restriction to restrict checkouts for a given patron 2. Check some items of a biblio out, go to "Items" tab, then "View item's checkout history" link. Compare views with and without patches
Created attachment 70386 [details] [review] Bug 19943: Remove C4::Biblio::GetBiblioItemData It is no longer used.
Comment on attachment 70385 [details] [review] Bug 19943: Koha::GetBiblioItemData - Replace existing occurrences Review of attachment 70385 [details] [review]: ----------------------------------------------------------------- ::: circ/bookcount.pl @@ +39,5 @@ > my $biblionumber = $input->param('biblionumber'); > > my $idata = itemdatanum($itm); > +my $biblio = Koha::Biblios->find( $biblionumber ); > +die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude! I believe if you purposefully call bookcount.pl directly so as to trigger this, GetBiblioItemData wouldn't die this way in the old code. Also, you can only call this from an existing catalogue/moredetail.tt page. Perhaps the uglier: $data = $biblio ? $biblio->unblessed : {}; ::: t/db_dependent/Biblio.t @@ +198,5 @@ > is( $marc->subfield( $title_field, $title_subfield ), $title, ); > > + my $biblioitem = Koha::Biblioitems->find( $biblioitemnumber ); > + is( $biblioitem->_result->biblio->title, $title, # Should be $biblioitem->biblio instead, but not needed elsewhere for now > + 'Do not know if this makes sense - compare result of previous two GetBiblioData tests.'); This test was proving that the GetBiblioItemData function worked by confirming that the title set in the Biblio was the one retrieved in this function. Given that this bug patch set removes the function, I'm not sure this test is needed at all. I'd recommend removing this one test.
(In reply to M. Tompsett from comment #4) > Comment on attachment 70385 [details] [review] [review] > Bug 19943: Koha::GetBiblioItemData - Replace existing occurrences > > Review of attachment 70385 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: circ/bookcount.pl > @@ +39,5 @@ > > my $biblionumber = $input->param('biblionumber'); > > > > my $idata = itemdatanum($itm); > > +my $biblio = Koha::Biblios->find( $biblionumber ); > > +die "No valid biblionumber passed" unless $biblio; # FIXME A bit rude! > > I believe if you purposefully call bookcount.pl directly so as to trigger > this, GetBiblioItemData wouldn't die this way in the old code. Also, you can > only call this from an existing catalogue/moredetail.tt page. > Perhaps the uglier: > $data = $biblio ? $biblio->unblessed : {}; Nope, I am waiting for output_and_exit_if_error from bug 18403 to deal with that. > ::: t/db_dependent/Biblio.t > @@ +198,5 @@ > > is( $marc->subfield( $title_field, $title_subfield ), $title, ); > > > > + my $biblioitem = Koha::Biblioitems->find( $biblioitemnumber ); > > + is( $biblioitem->_result->biblio->title, $title, # Should be $biblioitem->biblio instead, but not needed elsewhere for now > > + 'Do not know if this makes sense - compare result of previous two GetBiblioData tests.'); > > This test was proving that the GetBiblioItemData function worked by > confirming that the title set in the Biblio was the one retrieved in this > function. Given that this bug patch set removes the function, I'm not sure > this test is needed at all. I'd recommend removing this one test. I added a comment to tell that, so I think it's ok.
Created attachment 72568 [details] [review] Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued Just a preliminary step to clean the code a bit in CanBookBeIssued. The effective item type is already set from GetItem and we do not need to deal with that again. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 72569 [details] [review] Bug 19943: Koha::GetBiblioItemData - Replace existing occurrences The biblioitem's info can be retrieved with Koha::Biblio->biblioitem Test plan: 1. Use the age restriction to restrict checkouts for a given patron 2. Check some items of a biblio out, go to "Items" tab, then "View item's checkout history" link. Compare views with and without patches Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 72570 [details] [review] Bug 19943: Remove C4::Biblio::GetBiblioItemData It is no longer used. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 72593 [details] [review] Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued Just a preliminary step to clean the code a bit in CanBookBeIssued. The effective item type is already set from GetItem and we do not need to deal with that again. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 72594 [details] [review] Bug 19943: Koha::GetBiblioItemData - Replace existing occurrences The biblioitem's info can be retrieved with Koha::Biblio->biblioitem Test plan: 1. Use the age restriction to restrict checkouts for a given patron 2. Check some items of a biblio out, go to "Items" tab, then "View item's checkout history" link. Compare views with and without patches Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 72595 [details] [review] Bug 19943: Remove C4::Biblio::GetBiblioItemData It is no longer used. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 72596 [details] [review] Bug 19943: Gentle error handling for bookcount.pl This patch tests the required parameters and redirects with a 400 HTTP code if parameters are invalid. It also removes the need for the passed biblioitemnumber which is not used at all. A (now) useless sub is removed too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 73189 [details] [review] Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued Just a preliminary step to clean the code a bit in CanBookBeIssued. The effective item type is already set from GetItem and we do not need to deal with that again. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 73190 [details] [review] Bug 19943: Koha::Biblio - Replace GetBiblioItemData with Koha::Biblio->biblioitem The biblioitem's info can be retrieved with Koha::Biblio->biblioitem Test plan: 1. Use the age restriction to restrict checkouts for a given patron 2. Check some items of a biblio out, go to "Items" tab, then "View item's checkout history" link. Compare views with and without patches Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 73191 [details] [review] Bug 19943: Remove C4::Biblio::GetBiblioItemData It is no longer used. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 73192 [details] [review] Bug 19943: Gentle error handling for bookcount.pl This patch tests the required parameters and redirects with a 400 HTTP code if parameters are invalid. It also removes the need for the passed biblioitemnumber which is not used at all. A (now) useless sub is removed too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 18.05, thanks to everybody involved!
Created attachment 73194 [details] [review] Bug 19943: Fix NoIssuesChargeGuarantees.t - create the biblioitem entry
Created attachment 73198 [details] [review] Bug 19943: Fix dateexpiry.t - create the biblioitem entry
Created attachment 73199 [details] [review] Bug 19943: Fix SwitchOnSiteCheckouts.t - create the biblioitem entry
Created attachment 73200 [details] [review] Bug 19943: Fix Borrower_PrevCheckout.t - create the biblioitem entry
Last 4 patches pushed to master.
Enhancement, not backported for 17.11