@@ -, +, @@ Koha::Biblio - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t - Sign off :-D --- Koha/Biblio.pm | 5 ++--- Koha/Schema/Result/Biblio.pm | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -74,9 +74,8 @@ Returns a Koha::Biblio::Metadata object sub metadata { my ( $self ) = @_; - $self->{_metadata} ||= Koha::Biblio::Metadatas->find( { biblionumber => $self->id } ); - - return $self->{_metadata}; + my $metadata = $self->_result->metadata; + return Koha::Biblio::Metadata->_new_from_dbic($metadata); } =head3 subtitles --- a/Koha/Schema/Result/Biblio.pm +++ a/Koha/Schema/Result/Biblio.pm @@ -366,4 +366,11 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-11 12:56:41 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ebn7Szfm8/HbrdAc7ekTnA +__PACKAGE__->has_one( + "metadata", + "Koha::Schema::Result::BiblioMetadata", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + 1; --