From b870ea170ce9e379c3541ae6eeebe19229159694 Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Thu, 21 Jun 2007 15:40:03 +0000 Subject: [PATCH] Fixing issue #2735, deleteAll() does not work correctly with model aliases git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5323 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index b7557e10c..1a81d0d9a 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1271,7 +1271,9 @@ class DboSource extends DataSource { $table = $this->fullTableName($model); $conditions = $this->conditions($query); - if ($this->execute("DELETE FROM {$table} {$conditions}") === false) { + $alias = $this->alias . $this->name($model->name); + + if ($this->execute("DELETE FROM {$table} {$alias} {$conditions}") === false) { $model->onError(); return false; }