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: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
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: 2023-10-09 10:38 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.
Comment 1 Katrin Fischer 2023-10-08 11:13:24 UTC
Martin, can you tell if this is still valid?
Comment 2 Martin Renvoize 2023-10-09 10:38:14 UTC
Pretty sure we resolved this somewhere along the line already.. marking Resolved