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

            Bug ID: 39851
           Summary: Languages for REST API is returned in random order
 Change sponsored?: ---
           Product: Koha
           Version: 24.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]

At least for the tests:
Run t/db_dependent/api/v1/ill_requests.t several times. If you have several
languages installed it will fail randomly:

    #          $got->[0]{_strings}{status}{str} = 'Solicitado'
    #     $expected->[0]{_strings}{status}{str} = 'Requested'

or

    #          $got->[0]{_strings}{status}{str} = 'Angefordert'
    #     $expected->[0]{_strings}{status}{str} = 'Requested'

This is because getlanguage hit the else:

if ( $interface eq 'opac' || $interface eq 'intranet' ) { 
[...]
} else {                                                                        
    @languages = map { $_->{rfc4646_subtag} } @{ getTranslatedLanguages(
$interface, $theme ) };  
    $language  = Koha::Language->get_requested_language();                      
}

and getTranslatedLanguages returns the languages in a random order.

So there might be several problems highlighted here.

You can easily recreate the problem with:

use C4::Languages;
use C4::Context;
C4::Context->interface('api');
say C4::Languages::getlanguage();

-- 
You are receiving this mail because:
You are the assignee for the bug.
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/

Reply via email to