Bug 23186

Summary: Koha::Object->store precludes us from sending scalar references to dbic methods
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21761
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

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