From 337c50dcdc6c9741c6966b9dd7dc79bf2839f595 Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Wed, 6 Feb 2019 09:45:01 -0500 Subject: [PATCH 1/5] Change deprecated call to `Plugin::loaded()` --- config/defaults.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/defaults.php b/config/defaults.php index bcf53be1..d63f0c58 100644 --- a/config/defaults.php +++ b/config/defaults.php @@ -24,7 +24,7 @@ ], ], 'timezoneAwareDateTimeWidget' => false, - 'useAssetCompress' => Plugin::loaded('AssetCompress'), + 'useAssetCompress' => Plugin::isLoaded('AssetCompress'), 'tablesBlacklist' => [ 'phinxlog', ], From cb1d5649e6feb18377a819d7a7284a644905cdd0 Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Wed, 6 Feb 2019 09:45:40 -0500 Subject: [PATCH 2/5] Change access to deprecated property `CrudViewHelper::$request` --- src/View/Helper/CrudViewHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index a2ce79e7..4014b8a4 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -309,7 +309,7 @@ public function relation($field) */ public function redirectUrl() { - $redirectUrl = $this->request->getQuery('_redirect_url'); + $redirectUrl = $this->getView()->getRequest()->getQuery('_redirect_url'); $redirectUrlViewVar = $this->getViewVar('_redirect_url'); if (!empty($redirectUrlViewVar)) { @@ -351,7 +351,7 @@ public function createRelationLink($alias, $relation, $options = []) 'action' => 'add', '?' => [ $relation['foreignKey'] => $this->getViewVar('primaryKeyValue'), - '_redirect_url' => $this->request->getUri()->getPath() + '_redirect_url' => $this->getView()->getRequest()->getUri()->getPath() ] ], $options @@ -432,7 +432,7 @@ public function getViewVar($key = null) */ public function getCssClasses() { - $action = (string)$this->request->getParam('action'); + $action = (string)$this->getView()->getRequest()->getParam('action'); $pluralVar = $this->getViewVar('pluralVar'); $viewClasses = (array)$this->getViewVar('viewClasses'); $args = func_get_args(); From 8eff4ec8ef45d25c8a62436b7f9913421a2358f3 Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Wed, 6 Feb 2019 11:03:59 -0500 Subject: [PATCH 3/5] Change call to deprecated `Association::className()` --- src/Listener/ViewListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 0d2c25bf..7d609c4a 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -554,7 +554,7 @@ protected function _associations(array $whitelist = []) $associationConfiguration[$type][$assocKey]['displayField'] = $association->getTarget()->getDisplayField(); $associationConfiguration[$type][$assocKey]['foreignKey'] = $association->getForeignKey(); $associationConfiguration[$type][$assocKey]['propertyName'] = $association->getProperty(); - $associationConfiguration[$type][$assocKey]['plugin'] = pluginSplit($association->className())[0]; + $associationConfiguration[$type][$assocKey]['plugin'] = pluginSplit($association->getClassName())[0]; $associationConfiguration[$type][$assocKey]['controller'] = $assocKey; $associationConfiguration[$type][$assocKey]['entity'] = Inflector::singularize(Inflector::underscore($assocKey)); $associationConfiguration[$type][$assocKey]['entities'] = Inflector::underscore($assocKey); From f53554d3f5a10c543b9060d4d185d7fdaf02c82c Mon Sep 17 00:00:00 2001 From: Walther Lalk <83255+dakota@users.noreply.github.com> Date: Thu, 7 Mar 2019 10:56:42 +0200 Subject: [PATCH 4/5] Update the CakePHP 3.7+ --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4159d3f8..df3096e4 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ } ], "require": { - "cakephp/cakephp": "^3.5", + "cakephp/cakephp": "^3.7", "friendsofcake/crud": "^5.4", "friendsofcake/bootstrap-ui": "^1.4" }, From 9268196d5addfdb7ac1132c194949e8c1899a142 Mon Sep 17 00:00:00 2001 From: Walther Lalk <83255+dakota@users.noreply.github.com> Date: Thu, 7 Mar 2019 10:59:38 +0200 Subject: [PATCH 5/5] Add a prefer-lowest test --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee9e3ae0..a5a51405 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: env: global: - DEFAULT=1 + - LOWEST=0 matrix: fast_finish: true @@ -19,11 +20,15 @@ matrix: - php: 7.0 env: PHPSTAN=1 DEFAULT=0 + + - php: 7.2 + env: DEFAULT=1 LOWEST=1 before_script: - if [[ $TRAVIS_PHP_VERSION != 7.0 ]]; then phpenv config-rm xdebug.ini; fi - - composer install --prefer-dist --no-interaction + - if [[ $LOWEST = 0 ]]; then composer install --prefer-dist --no-interaction; fi + - if [[ $LOWEST = 1 ]]; then composer update --prefer-lowest --prefer-dist --no-interaction; fi - if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:dev-master; fi - if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan:^0.9; fi