https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383
--- Comment #34 from Marcel de Rooy <[email protected]> --- Will add a follow-up for this bug. We need to check $lang before searching translated content. And which was very bad, we do not need to search for additional_content_id in the wrong column. diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm index 0555ddc6d1..7d5e877d0f 100644 --- a/Koha/AdditionalContents.pm +++ b/Koha/AdditionalContents.pm @@ -85,9 +85,9 @@ sub search_for_display { my $contents = $self->SUPER::search( $search_params, { order_by => 'number' } ); my @all_content_id = $contents->get_column('id'); - my @translated_content_id; - if ( $params->{lang} ) { - my $translated_contents = Koha::AdditionalContentsLocalizations->search( + my ( $translated_contents, @translated_content_id ); + if ( $params->{lang} && $params->{lang} ne 'default' ) { + $translated_contents = Koha::AdditionalContentsLocalizations->search( { additional_content_id => [$contents->get_column('id')], lang => $params->{lang}, @@ -105,7 +105,7 @@ sub search_for_display { return Koha::AdditionalContentsLocalizations->search( { - id => [@translated_content_id, $default_contents->get_column('id')] + id => [ $translated_contents ? $translated_contents->get_column('id') : (), $default_contents->get_column('id') ] }, ); -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
