From 2677cf4053e3ce2c36539ebf9fd856e7cd3dca3f Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Wed, 7 Jun 2017 23:38:12 +0200 Subject: [PATCH] Takes into account the current recursive value in deleteAll(). --- lib/Cake/Model/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index dff60b57e..1f2b1effb 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2832,12 +2832,12 @@ class Model extends CakeObject implements CakeEventListener { if (!$cascade && !$callbacks) { return $db->delete($this, $conditions); } - + $recursive = min($this->recursive, 0); $ids = $this->find('all', array_merge(array( 'fields' => "{$this->alias}.{$this->primaryKey}", 'order' => false, 'group' => "{$this->alias}.{$this->primaryKey}", - 'recursive' => 0), compact('conditions')) + 'recursive' => $recursive), compact('conditions')) ); if ($ids === false || $ids === null) {