[Koha-bugs] [Bug 25423] New: Methods update and empty from Koha::Objects are not class methods

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 8 13:12:40 CEST 2020


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

            Bug ID: 25423
           Summary: Methods update and empty from Koha::Objects are not
                    class methods
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: jonathan.druart at bugs.koha-community.org
        QA Contact: testopia at bugs.koha-community.org

They should be called with an instance of the class, not directly as class
methods:

  Koha::Object->new->empty
vs
  Koha::Object->empty

A trick has been done earlier to accept the second form, but as we notice the
same need/problem for another method it seems better to enforce a rule and
forbid such calls.

An exception will be raised if the methods are called without an instantiated
object.

See also
  commit 4805b9b9dd0a95d79faf450ed1aaaec62d544ec6
  Bug 25296: Make ->empty work for uninstantiated calls

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