Bug 23186 - Koha::Object->store precludes us from sending scalar references to dbic methods
Summary: Koha::Object->store precludes us from sending scalar references to dbic methods
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-21 15:56 UTC by Martin Renvoize
Modified: 2019-06-21 15:57 UTC (History)
0 users

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 Martin Renvoize 2019-06-21 15:56:51 UTC
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.