Bug 15835 - Koha::Object does not save changes
Summary: Koha::Object does not save changes
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-17 07:06 UTC by Srdjan Jankovic
Modified: 2016-12-05 21:23 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srdjan Jankovic 2016-02-17 07:06:56 UTC
$object->set({column => $val})->store does not work.
DB trace:
BEGIN WORK
COMMIT

On the other hand, $object->_result()->update({column => $val}) does work.
DB trace:
BEGIN WORK
UPDATE borrowers SET overdrive_auth_token = ? WHERE ( borrowernumber = ? ): XXX, YYY
COMMIT
Comment 1 Jonathan Druart 2016-02-17 10:15:36 UTC
Srdjan, what did you try exactly?

I have tried the following:

  use Modern::Perl;
  use Koha::Borrowers;
  my $p = Koha::Borrowers->find(10);
  $p->set({firstname => 'my new firstname', surname => 'my new surname' })->store;

then

  MariaDB [koha]> select firstname, surname from borrowers where borrowernumber=10;

And I got my updated values.
Comment 2 Srdjan Jankovic 2016-02-18 01:03:07 UTC
Well I cannot make it happen now myself. Who knows what was going on...