[Koha-bugs] [Bug 27660] New: Should getletter not use the fallback to default ?

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 9 13:23:32 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27660

            Bug ID: 27660
           Summary: Should getletter not use the fallback to default ?
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Notices
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org

Looking at the code:

sub getletter {
    my ( $module, $code, $branchcode, $message_transport_type, $lang) = @_;
..
    $lang = 'default' unless( $lang &&
C4::Context->preference('TranslateNotices') );
..
    my $sth = $dbh->prepare(q{
        SELECT *
        FROM letter
        WHERE module=? AND code=? AND (branchcode = ? OR branchcode = '')
        AND message_transport_type LIKE ?
        AND lang =?
        ORDER BY branchcode DESC LIMIT 1
    });
    $sth->execute( $module, $code, $branchcode, $message_transport_type, $lang
);
    my $line = $sth->fetchrow_hashref
      or return;
  ..

I am just wondering if I miss something. If the language is passed (which is
often just a $patron->lang or so), then we are fetching with that language! If
that notice has not been translated yet, we will not fallback to en ?!

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list