[Koha-bugs] [Bug 19493] New: Remove two warnings from circulation.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 19 09:44:47 CEST 2017


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

            Bug ID: 19493
           Summary: Remove two warnings from circulation.pl
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org

If you click Submit on the staff home page without entering a cardnumber, you
will find these warnings in the log:
Problem = a value of override_high_holds has been passed to param without key
at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of nopermission has been passed to param without key at
/usr/share/koha/masterclone/C4/Templates.pm line 137.
Use of uninitialized value $val in concatenation (.) or string at
/usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of  has been passed to param without key at
/usr/share/koha/masterclone/C4/Templates.pm line 137.

Cause is this call to $template->param:
$template->param(
     CircAutocompl             => C4::Context->preference("CircAutocompl"),
     debarments                => GetDebarments({ borrowernumber =>
$borrowernumber }),
     todaysdate                => output_pref( { dt =>
dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
    has_modifications         => $has_modifications,
     override_high_holds       => $override_high_holds,
     nopermission              => scalar $query->param('nopermission'),

In this specific case GetDebarments returns undef in list context (empty list),
so all items in the list shift one place.
Either we should force GetDebarments to return []; or we force scalar context
in a construction like this.

Note: The calls in memberentry.pl and moremember.pl are not affected.

-- 
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