From 5526c98c6c2fac6e9e2d3f7fba786388f1999321 Mon Sep 17 00:00:00 2001 From: schnauss Date: Wed, 2 Apr 2014 14:51:28 -0400 Subject: [PATCH 1/2] Update readme.md Changed code snippet to point new users in the direction of query strings instead of named parameters. --- readme.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 09817d9..f90a3ac 100644 --- a/readme.md +++ b/readme.md @@ -67,7 +67,12 @@ class Article extends AppModel { Associated snippet for the controller class: ```php class ArticlesController extends AppController { - public $components = array('Search.Prg'); + public $components = array( + 'Search.Prg' => array( + 'commonProcess' => array( + 'paramType' => 'querystring', + ), + )); public $presetVars = true; // using the model configuration From 31b3f163f8eb86ebaf6d872292f4901410ecb820 Mon Sep 17 00:00:00 2001 From: Cait Bailey Date: Thu, 15 Jul 2021 10:41:35 -0400 Subject: [PATCH 2/2] Fixed issue with CakePHP versions 2.10+ --- Model/Behavior/SearchableBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Behavior/SearchableBehavior.php b/Model/Behavior/SearchableBehavior.php index 8e4eed3..91685a3 100755 --- a/Model/Behavior/SearchableBehavior.php +++ b/Model/Behavior/SearchableBehavior.php @@ -355,13 +355,13 @@ protected function _addCondLike(Model $Model, &$conditions, $data, $field, $like */ protected function _connectedLike($value, $field, $fieldName, $likeMethod = 'LIKE') { $or = array(); - if (Configure::version() < '2.7') { + if (version_compare(Configure::version(), '2.7') < 0) { $orValues = String::tokenize($value, $field['connectorOr']); } else { $orValues = CakeText::tokenize($value, $field['connectorOr']); } foreach ($orValues as $orValue) { - if (Configure::version() < '2.7') { + if (version_compare(Configure::version(), '2.7') < 0) { $andValues = String::tokenize($orValue, $field['connectorAnd']); } else { $andValues = CakeText::tokenize($orValue, $field['connectorAnd']);