Bugzilla – Attachment 88903 Details for
Bug 15496
Delete bibliographic record after moving last item to another record(s)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15496: (QA Followup) Fix new uses of Koha::Biblio::items in list context
Bug-15496-QA-Followup-Fix-new-uses-of-KohaBiblioit.patch (text/plain), 3.70 KB, created by
Kyle M Hall (khall)
on 2019-04-26 11:44:58 UTC
(
hide
)
Description:
Bug 15496: (QA Followup) Fix new uses of Koha::Biblio::items in list context
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-04-26 11:44:58 UTC
Size:
3.70 KB
patch
obsolete
>From 8f1caca69b326469b9a8efc23010f43a1f41cf83 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 26 Apr 2019 07:44:46 -0400 >Subject: [PATCH] Bug 15496: (QA Followup) Fix new uses of Koha::Biblio::items > in list context > >--- > C4/ILSDI/Services.pm | 2 +- > Koha/Biblio.pm | 6 +++--- > Koha/Schema/Result/SocialData.pm | 7 ++++--- > t/db_dependent/Koha/Biblio.t | 2 +- > 4 files changed, 9 insertions(+), 8 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 56a2f18114..43935bbf8f 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -230,7 +230,7 @@ sub GetRecords { > my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; > my $holds = $biblio->current_holds->unblessed; > my $issues = GetBiblioIssues($biblionumber); >- my @items = $biblio->items; >+ my @items = $biblio->items->as_list; > > $biblioitem->{items}->{item} = []; > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 688edc85ae..3cfce72192 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -154,7 +154,7 @@ sub can_be_transferred { > my $limittype = C4::Context->preference('BranchTransferLimitsType'); > > my $items; >- foreach my $item_of_bib ($self->items) { >+ foreach my $item_of_bib ($self->items->as_list) { > next unless $item_of_bib->holdingbranch; > next if $from && $from->branchcode ne $item_of_bib->holdingbranch; > return 1 if $item_of_bib->holdingbranch eq $to->branchcode; >@@ -207,7 +207,7 @@ sub hidden_in_opac { > > my $rules = $params->{rules} // {}; > >- return !(any { !$_->hidden_in_opac({ rules => $rules }) } $self->items); >+ return !(any { !$_->hidden_in_opac({ rules => $rules }) } $self->items->as_list); > } > > =head3 article_request_type >@@ -457,7 +457,7 @@ sub has_items_waiting_or_intransit { > return 1; > } > >- foreach my $item ( $self->items ) { >+ foreach my $item ( $self->items->as_list ) { > return 1 if $item->get_transfer; > } > >diff --git a/Koha/Schema/Result/SocialData.pm b/Koha/Schema/Result/SocialData.pm >index b2d835b0b0..b3ff53788f 100644 >--- a/Koha/Schema/Result/SocialData.pm >+++ b/Koha/Schema/Result/SocialData.pm >@@ -26,6 +26,7 @@ __PACKAGE__->table("social_data"); > =head2 isbn > > data_type: 'varchar' >+ default_value: (empty string) > is_nullable: 0 > size: 30 > >@@ -64,7 +65,7 @@ __PACKAGE__->table("social_data"); > > __PACKAGE__->add_columns( > "isbn", >- { data_type => "varchar", is_nullable => 0, size => 30 }, >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 30 }, > "num_critics", > { data_type => "integer", is_nullable => 1 }, > "num_critics_pro", >@@ -92,8 +93,8 @@ __PACKAGE__->add_columns( > __PACKAGE__->set_primary_key("isbn"); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-11-13 15:24:28 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l44tYFEfIKX0xXzj6AHInQ >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-26 11:35:30 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0ur/YLKxuN8w2jVUyc8EnA > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 1e050ca68d..18b3bf2f44 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -101,7 +101,7 @@ subtest 'items() tests' => sub { > is( ref($items), 'Koha::Items', 'Returns a Koha::Items resultset' ); > is( $items->count, 2, 'Two items in resultset' ); > >- my @items = $biblio->items; >+ my @items = $biblio->items->as_list; > is( scalar @items, 2, 'Same result, but in list context' ); > > $schema->storage->txn_rollback; >-- >2.20.1 (Apple Git-117)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15496
:
88004
|
88005
|
88006
|
88008
|
88015
|
88016
|
88017
|
88018
|
88019
|
88020
|
88026
|
88027
|
88028
|
88029
|
88030
|
88031
|
88032
|
88165
|
88166
|
88167
|
88168
|
88169
|
88170
|
88171
|
88172
|
88215
|
88225
|
88226
|
88227
|
88228
|
88229
|
88230
|
88892
|
88893
|
88894
|
88895
|
88896
|
88897
|
88903
|
88905
|
88920
|
88938
|
88950