View | Details | Raw Unified | Return to bug 36875
Collapse All | Expand All

(-)a/Koha/AdditionalContent.pm (-3 / +3 lines)
Lines 134-142 Return the translated content for a given language. The default is returned if n Link Here
134
134
135
sub translated_content {
135
sub translated_content {
136
    my ( $self, $lang ) = @_;
136
    my ( $self, $lang ) = @_;
137
    $lang ||= 'default';
137
    my $content = $self->translated_contents->search(
138
    my $content = $self->translated_contents->search(
138
        { lang => [ 'default', ( $lang ? $lang : () ) ] },
139
        { lang     => [ 'default', $lang ] },
139
        { ( $lang ? ( order_by => \[ "field(lang, '" . $lang . "', 'default')" ] ) : () ) }
140
        { order_by => { -asc => [ \'lang="default"', 'id' ] } }
140
    )->next;
141
    )->next;
141
    return $content;
142
    return $content;
142
}
143
}
143
- 

Return to bug 36875