Skip to content

Commit

Permalink
Merge pull request #259 from FriendsOfCake/fix-some-deprecations
Browse files Browse the repository at this point in the history
Fix some deprecations
  • Loading branch information
dakota authored Mar 7, 2019
2 parents 65ffb8e + 9268196 commit c09f8d4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ php:
env:
global:
- DEFAULT=1
- LOWEST=0

matrix:
fast_finish: true
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
],
"require": {
"cakephp/cakephp": "^3.5",
"cakephp/cakephp": "^3.7",
"friendsofcake/crud": "^5.4",
"friendsofcake/bootstrap-ui": "^1.4"
},
Expand Down
2 changes: 1 addition & 1 deletion config/defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
],
'timezoneAwareDateTimeWidget' => false,
'useAssetCompress' => Plugin::loaded('AssetCompress'),
'useAssetCompress' => Plugin::isLoaded('AssetCompress'),
'tablesBlacklist' => [
'phinxlog',
],
Expand Down
2 changes: 1 addition & 1 deletion src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/View/Helper/CrudViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit c09f8d4

Please sign in to comment.