Bug 28880 - Warning in tr (at Mojo/Headers.pm) because of undef X-Base-Total-Count HTTP header value
Summary: Warning in tr (at Mojo/Headers.pm) because of undef X-Base-Total-Count HTTP h...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on: 27353
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-18 18:24 UTC by Andrii Nugged
Modified: 2021-08-19 08:18 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrii Nugged 2021-08-18 18:24:41 UTC
There was an introduced X-Base-Total-Count header for REST API in Bug 27353.

When used from external plugins and "base_total" not provided (is it mandatory?) all logs are heavily filled with:

    [WARN] Use of uninitialized value $_ in transliteration (tr///)
           at /usr/share/perl5/Mojo/Headers.pm line 43.

It's because X-Base-Total-Count comes with "undef" as I debugged,
what solution to choose:

A. should we demand this value from plugin creators?
B. or should we add this (not "0" as default, anyway, right?):

    my $base_total = $args->{base_total} // $total;

to Koha/REST/Plugin/Pagination.pm line 63?