diff --git a/.gitignore b/.gitignore index ca21e90..82dcd5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.settings/ /.buildpath /.project +/Vendor/ diff --git a/Controller/Component/FilterComponent.php b/Controller/Component/FilterComponent.php index 3774b03..0e6a8fb 100644 --- a/Controller/Component/FilterComponent.php +++ b/Controller/Component/FilterComponent.php @@ -280,7 +280,7 @@ public function beforeRender(Controller $controller) break; default: - continue; + continue 2; } // if no value has been set, show the default one diff --git a/Model/Behavior/FilteredBehavior.php b/Model/Behavior/FilteredBehavior.php index 0392469..1ff8579 100644 --- a/Model/Behavior/FilteredBehavior.php +++ b/Model/Behavior/FilteredBehavior.php @@ -354,7 +354,7 @@ protected function buildFilterConditions(array &$query, $field, $options, $value case 'text': if (strlen(trim(strval($value))) == 0) { - continue; + break; } $condition = $options['condition']; @@ -385,7 +385,7 @@ protected function buildFilterConditions(array &$query, $field, $options, $value case 'select': if (is_string($value) && strlen(trim(strval($value))) == 0) { - continue; + break; } $query['conditions'][$field] = $value; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9890f5a --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name": "kba-team/cakephp-filter-plugin", + "description": "Filter is a CakePHP plugin which enables you to create filtering forms for your data in a very fast and simple way, without getting in the way of paging, sorting and other \"standard\" things when displaying data. It also remembers the filter conditions in a session, but this can be turned off if undesirable.", + "type": "cakephp-plugin", + "license": "GPL-3.0-or-later", + "minimum-stability": "stable", + "require": { + "php": "^7.2", + "cakephp/cakephp": "^2.4", + "composer/installers": "^1.9" + }, + "extra": { + "installer-name": "Filter" + }, + "config": { + "vendor-dir": "Vendor/" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..2bfd683 --- /dev/null +++ b/composer.lock @@ -0,0 +1,223 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "282714e63af34398436c701d896aa2db", + "packages": [ + { + "name": "cakephp/cakephp", + "version": "2.10.24", + "source": { + "type": "git", + "url": "https://github.com/cakephp/cakephp.git", + "reference": "cf14e6546ec44e3369e3531add11fdb946656280" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/cf14e6546ec44e3369e3531add11fdb946656280", + "reference": "cf14e6546ec44e3369e3531add11fdb946656280", + "shasum": "" + }, + "require": { + "php": ">=5.3.0,<8.0.0" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^1.0.0", + "phpunit/phpunit": "^3.7" + }, + "suggest": { + "ext-mcrypt": "You need to install ext-openssl or ext-mcrypt to use AES-256 encryption", + "ext-openssl": "You need to install ext-openssl or ext-mcrypt to use AES-256 encryption" + }, + "bin": [ + "lib/Cake/Console/cake" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/cakephp/graphs/contributors" + } + ], + "description": "The CakePHP framework", + "homepage": "https://cakephp.org", + "keywords": [ + "framework" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/cakephp" + }, + "time": "2020-12-16T02:47:53+00:00" + }, + { + "name": "composer/installers", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "ae03311f45dfe194412081526be2e003960df74b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/ae03311f45dfe194412081526be2e003960df74b", + "reference": "ae03311f45dfe194412081526be2e003960df74b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "tastyigniter", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.11.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-28T06:42:17+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.2" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +}