mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 02:52:41 +00:00
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)
This commit is contained in:
parent
6722a8d8ea
commit
1dbb6dd0e4
1 changed files with 1 additions and 1 deletions
|
@ -90,7 +90,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
*/
|
||||
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'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue