[Koha-bugs] [Bug 32472] New: The method Koha::Item->count is not covered by tests

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 15 08:11:08 CET 2022


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

            Bug ID: 32472
           Summary: The method Koha::Item->count is not covered by tests
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          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

This is only possible under 21.11 (before bug Bug 29844 - Remove uses of
wantarray in Koha::Objects) in templates where constructions like items.count
etc are used on passed objects.
Template Toolkit does evaluate these expressions in LIST context while we
probably expected scalar context as when chaining in Perl.

This particular crash comes from acqui/orderreceive.pl (and template):
[% IF ( order.items.count ) %]
In this case we should either use the Scalar plugin or - simply - use size here
from TT itself.
Note that this could be applied to master too since it is probably cheaper to
stay in TT than call Koha::Objects/DBI here.

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