Skip to content

Commit

Permalink
Ignore counter cache also
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Jan 23, 2015
1 parent c0ee49f commit 5e89e89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Cake/Model/Datasource/Session/DatabaseSession.php
Expand Up @@ -118,7 +118,11 @@ public function write($id, $data) {
$record = compact('id', 'data', 'expires');
$record[$this->_model->primaryKey] = $id;

$options = array('validate' => false, 'callbacks' => false);
$options = array(
'validate' => false,
'callbacks' => false,
'counterCache' => false
);
try {
return $this->_model->save($record, $options);
} catch (PDOException $e) {
Expand Down

3 comments on commit 5e89e89

@djkrul
Copy link

@djkrul djkrul commented on 5e89e89 May 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AD7six: Could you please revert this change and re-enable callbacks (or make the behavior configurable)? I use beforeSave() to add user_id to sessions stored in the database that is probably quite a common use case, so I consider this to be a regression.

@ADmad
Copy link
Member

@ADmad ADmad commented on 5e89e89 May 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djkrul Don't post comments on old commits, open an issue.

@djkrul
Copy link

@djkrul djkrul commented on 5e89e89 May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, sorry about that. Created issue #8885

Please sign in to comment.