[Koha-bugs] [Bug 23186] New: Koha::Object->store precludes us from sending scalar references to dbic methods

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 21 17:56:51 CEST 2019


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

            Bug ID: 23186
           Summary: Koha::Object->store precludes us from sending scalar
                    references to dbic methods
 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: martin.renvoize at ptfs-europe.com
        QA Contact: testopia at bugs.koha-community.org
  Target Milestone: ---

Under the hood the store method uses DBIx::Classes update_or_insert which in
turn calls update for updates.

The update method accepts a hashref of key value pairs relating to fields to be
udpated. If the value is a scalar ref then it passes the it through unaltered
to the database and as such things like 'NOW()' and 'field + 1' can be used
allowing the database to do some of the work. -
https://metacpan.org/pod/DBIx::Class::Row#update

As it stands, we will catch such values and replace them silently with
defaults.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list