fix: [crud:edit] Always specify the table alias when fetching by id
parent
af622dd19b
commit
a3fd138b4d
|
@ -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']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue