Browse Source

Merge pull request #3021 from wvdongen/master

Fixed bug where select query in deleteAll could return wrong table name
Mark Story 12 years ago
parent
commit
514974900f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/Cake/Model/Model.php

+ 2 - 1
lib/Cake/Model/Model.php

@@ -2703,8 +2703,9 @@ class Model extends Object implements CakeEventListener {
 		}
 
 		$ids = $this->find('all', array_merge(array(
-			'fields' => "DISTINCT {$this->alias}.{$this->primaryKey}",
+			'fields' => "{$this->alias}.{$this->primaryKey}",
 			'order' => false,
+			'group' => "{$this->alias}.{$this->primaryKey}",
 			'recursive' => 0), compact('conditions'))
 		);