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 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" }, 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', ], 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); 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();