From f3445cd94152c478fc30700307a8c824815574ca Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 12 Dec 2010 18:04:47 -0500 Subject: [PATCH] Making ModelBehavior::beforeFind() return true by default. Since returning null causes the find to abort, behaviors should return true if they are not going to return a query array. --- cake/libs/model/model_behavior.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index 46ad69165..d0093e95e 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -80,10 +80,13 @@ class ModelBehavior extends Object { * * @param object $model Model using this behavior * @param array $queryData Data used to execute this query, i.e. conditions, order, etc. - * @return mixed False or null will abort the operation. You should array will replace the value of $query. + * @return mixed False or null will abort the operation. You can return an array to replace the + * $query that will be eventually run. * @access public */ - public function beforeFind($model, $query) { } + public function beforeFind($model, $query) { + return true; + } /** * After find callback. Can be used to modify any results returned by find and findAll.