fix: [crud:edit] Always specify the table alias when fetching by id

pull/121/head
Sami Mokaddem 2022-12-09 11:56:03 +01:00
parent af622dd19b
commit a3fd138b4d
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -521,7 +521,7 @@ class CRUDComponent extends Component
$params['contain'] = [$params['contain'], 'MetaFields']; $params['contain'] = [$params['contain'], 'MetaFields'];
} }
} }
$query = $this->Table->find()->where(['id' => $id]); $query = $this->Table->find()->where(["{$this->TableAlias}.id" => $id]);
if (!empty($params['contain'])) { if (!empty($params['contain'])) {
$query->contain($params['contain']); $query->contain($params['contain']);
} }