Skip to content
Permalink
Browse files

Update DatabaseSession.php

To prevent error: "Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous" when using a custom Session object in relationship with another object (belongsTo <-| hasMany)
  • Loading branch information...
thomasvnl committed Sep 9, 2015
1 parent 6722a8d commit 1dbb6dd0e4a899071a1be114785ad8d68104af00
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/Datasource/Session/DatabaseSession.php
@@ -90,7 +90,7 @@ public function close() {
*/
public function read($id) {
$row = $this->_model->find('first', array(
'conditions' => array($this->_model->primaryKey => $id)
'conditions' => array($this->_model->alias . '.' . $this->_model->primaryKey => $id)
));
if (empty($row[$this->_model->alias]['data'])) {

0 comments on commit 1dbb6dd

Please sign in to comment.
You can’t perform that action at this time.