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

(-)a/opac/opac-page.pl (-2 / +1 lines)
Lines 45-51 if (C4::Context->userenv) { Link Here
45
if( $page_id ) {
45
if( $page_id ) {
46
    $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] });
46
    $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] });
47
} elsif( $code ) {
47
} elsif( $code ) {
48
    my $lang = $query->param('language') || $query->cookie('KohaOpacLanguage');
48
    my $lang = $query->param('language') || $query->cookie('KohaOpacLanguage') || $template->lang;
49
    # In the next query we make sure that the 'default' records come after the regular languages
49
    # In the next query we make sure that the 'default' records come after the regular languages
50
    $page = Koha::AdditionalContents->search({ code => $code, lang => ['default', $lang], location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] }, { order_by => { -desc => \[ 'CASE WHEN lang="default" THEN "" ELSE lang END' ]}} );
50
    $page = Koha::AdditionalContents->search({ code => $code, lang => ['default', $lang], location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] }, { order_by => { -desc => \[ 'CASE WHEN lang="default" THEN "" ELSE lang END' ]}} );
51
}
51
}
52
- 

Return to bug 32251