From 0df64fb0e54130ad2dfd9c7f0eaceea9cb994638 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:23:28 -0600 Subject: [PATCH 01/24] feat: upgrade minimum cakephp version to 3.4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0314dc1f..0a079d93 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ } ], "require": { - "cakephp/cakephp": "~3.0", + "cakephp/cakephp": "~3.4", "friendsofcake/crud": "*", "friendsofcake/bootstrap-ui": "~1.2" }, From caf4617a35138c403b17bcf415f24e34fc97d6e4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:24:07 -0600 Subject: [PATCH 02/24] tests: run travis against at 5.6+ --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a2d66def..316a2eb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ language: php php: - - 7 + - 5.6 + - 7.0 + - 7.1 before_script: - composer self-update From 61bece114050b2067023c87d248e883ba8970d12 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:24:31 -0600 Subject: [PATCH 03/24] docs: Upgrade examples to use non-deprecated method calls --- docs/_partials/pages/index/download-format-links.rst | 6 +++--- docs/_partials/pages/index/finder-scopes.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/_partials/pages/index/download-format-links.rst b/docs/_partials/pages/index/download-format-links.rst index 4325b435..eba4d217 100644 --- a/docs/_partials/pages/index/download-format-links.rst +++ b/docs/_partials/pages/index/download-format-links.rst @@ -20,11 +20,11 @@ Each sub-array should contain ``title`` and ``url`` parameters. $action->config('scaffold.index_formats', [ [ 'title' => 'JSON', - 'url' => ['_ext' => 'json', '?' => $this->request->query] + 'url' => ['_ext' => 'json', '?' => $this->request->getQueryParams()] ], [ 'title' => 'XML', - 'url' => Router::url(['_ext' => 'xml', '?' => $this->request->query]) + 'url' => Router::url(['_ext' => 'xml', '?' => $this->request->getQueryParams()]) ], ]); @@ -86,7 +86,7 @@ can be modified to add a CSV Download Link. $this->Crud->action()->config('scaffold.index_formats', [ [ 'title' => 'CSV', - 'url' => ['_ext' => 'csv', '?' => $this->request->query] + 'url' => ['_ext' => 'csv', '?' => $this->request->getQueryParams()] ], ]); return $this->Crud->execute(); diff --git a/docs/_partials/pages/index/finder-scopes.rst b/docs/_partials/pages/index/finder-scopes.rst index 450f9d8f..05c9f87b 100644 --- a/docs/_partials/pages/index/finder-scopes.rst +++ b/docs/_partials/pages/index/finder-scopes.rst @@ -70,8 +70,8 @@ result-set. This can be done in the mapped action as follows: ]); // We don't need to check for `all` as it is the default findMethod - if (in_array($this->request->query('finder'), ['active', 'inactive'])) { - $this->Crud->action()->config('findMethod', $this->request->query('finder')); + if (in_array($this->request->getQuery('finder'), ['active', 'inactive'])) { + $this->Crud->action()->config('findMethod', $this->request->getQuery('finder')); } return $this->Crud->execute(); } From 5fd9bd81eefeda4c3505a68384d1d9968d90890b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:28:10 -0600 Subject: [PATCH 04/24] fix: update deprecated calls to retrieve subject --- docs/basic-usage.rst | 10 +++++----- src/Listener/ViewListener.php | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/basic-usage.rst b/docs/basic-usage.rst index 3f03f4cc..e3cb8b1f 100644 --- a/docs/basic-usage.rst +++ b/docs/basic-usage.rst @@ -101,7 +101,7 @@ alter the ``contain()`` list for the pagination query: public function index() { $this->Crud->on('beforePaginate', function ($event) { - $paginationQuery = $event->subject()->query; + $paginationQuery = $event->getSubject()->query; $paginationQuery->contain([ 'Categories', 'Authors' => ['fields' => ['id', 'name']] @@ -306,9 +306,9 @@ you can use the ``relatedModels`` event: public function add() { $this->Crud->on('relatedModel', function(\Cake\Event\Event $event) { - if ($event->subject->association->name() === 'Categories') { - $event->subject->query->limit(3); - $event->subject->query->where(['is_active' => true]); + if ($event->getSubject()->association->name() === 'Categories') { + $event->getSubject()->query->limit(3); + $event->getSubject()->query->where(['is_active' => true]); } }); return $this->Crud->execute(); @@ -483,7 +483,7 @@ alter the ``contain()`` list for the pagination query: public function view() { $this->Crud->on('beforeFind', function ($event) { - $event->subject()->query->contain([ + $event->getSubject()->query->contain([ 'Categories', 'Authors' => ['fields' => ['id', 'name']] ]); diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index cf5d878e..6886ffed 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -41,8 +41,8 @@ class ViewListener extends BaseListener public function beforeFind(Event $event) { $this->associations = $this->_associations(array_keys($this->_getRelatedModels())); - if (!$event->subject()->query->contain()) { - $event->subject()->query->contain($this->_getRelatedModels()); + if (!$event->getSubject()->query->contain()) { + $event->getSubject()->query->contain($this->_getRelatedModels()); } } @@ -55,8 +55,8 @@ public function beforeFind(Event $event) public function beforePaginate(Event $event) { $this->associations = $this->_associations(array_keys($this->_getRelatedModels())); - if (!$event->subject()->query->contain()) { - $event->subject()->query->contain($this->_getRelatedModels(['manyToOne', 'oneToOne'])); + if (!$event->getSubject()->query->contain()) { + $event->getSubject()->query->contain($this->_getRelatedModels(['manyToOne', 'oneToOne'])); } } @@ -72,8 +72,8 @@ public function beforeRender(Event $event) return; } - if (!empty($event->subject()->entity)) { - $this->_entity = $event->subject()->entity; + if (!empty($event->getSubject()->entity)) { + $this->_entity = $event->getSubject()->entity; } if (empty($this->associations)) { @@ -127,8 +127,8 @@ public function ensureConfig() */ public function setFlash(Event $event) { - unset($event->subject()->params['class']); - $event->subject()->element = ltrim($event->subject()->type); + unset($event->getSubject()->params['class']); + $event->getSubject()->element = ltrim($event->getSubject()->type); } /** From 810dfe7b0a224efea618b4425ab4702b369f8fd7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:31:42 -0600 Subject: [PATCH 05/24] fix: update deprecated calls to get config keys --- src/Listener/Traits/FormTypeTrait.php | 16 +++---- src/Listener/Traits/IndexTypeTrait.php | 18 ++++---- .../Traits/SidebarNavigationTrait.php | 4 +- src/Listener/Traits/SiteTitleTrait.php | 8 ++-- .../Traits/UtilityNavigationTrait.php | 2 +- src/Listener/ViewListener.php | 44 +++++++++---------- src/Listener/ViewSearchListener.php | 6 +-- 7 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php index 4cf36c20..038dd0d3 100644 --- a/src/Listener/Traits/FormTypeTrait.php +++ b/src/Listener/Traits/FormTypeTrait.php @@ -38,9 +38,9 @@ protected function _getFormEnableDirtyCheck() { $action = $this->_action(); - $formEnableDirtyCheck = $action->config('scaffold.form_enable_dirty_check'); + $formEnableDirtyCheck = $action->getConfig('scaffold.form_enable_dirty_check'); if ($formEnableDirtyCheck === null) { - $formEnableDirtyCheck = $action->config('scaffold.enable_dirty_check'); + $formEnableDirtyCheck = $action->getConfig('scaffold.enable_dirty_check'); if ($formEnableDirtyCheck !== null) { $this->deprecatedScaffoldKeyNotice( 'scaffold.enable_dirty_check', @@ -61,9 +61,9 @@ protected function _getFormSubmitButtonText() { $action = $this->_action(); - $formSubmitButtonText = $action->config('scaffold.form_submit_button_text'); + $formSubmitButtonText = $action->getConfig('scaffold.form_submit_button_text'); if ($formSubmitButtonText === null) { - $formSubmitButtonText = $action->config('scaffold.submit_button_text'); + $formSubmitButtonText = $action->getConfig('scaffold.submit_button_text'); if ($formSubmitButtonText !== null) { $this->deprecatedScaffoldKeyNotice( 'scaffold.submit_button_text', @@ -132,7 +132,7 @@ protected function _getFormSubmitExtraButtons() $defaults = $newDefaults; } - $buttons = $action->config('scaffold.form_submit_extra_buttons'); + $buttons = $action->getConfig('scaffold.form_submit_extra_buttons'); if ($buttons === null || $buttons === true) { $buttons = $defaults; } @@ -154,7 +154,7 @@ protected function _getFormDisableExtraButtons() { $action = $this->_action(); - return $action->config('scaffold.disable_extra_buttons') ?: false; + return $action->getConfig('scaffold.disable_extra_buttons') ?: false; } /** @@ -167,7 +167,7 @@ protected function _getFormExtraButtonsBlacklist() { $action = $this->_action(); - return $action->config('scaffold.extra_buttons_blacklist') ?: []; + return $action->getConfig('scaffold.extra_buttons_blacklist') ?: []; } /** @@ -179,7 +179,7 @@ protected function _getFormUrl() { $action = $this->_action(); - return $action->config('scaffold.form_action') ?: null; + return $action->getConfig('scaffold.form_action') ?: null; } /** diff --git a/src/Listener/Traits/IndexTypeTrait.php b/src/Listener/Traits/IndexTypeTrait.php index 10231527..742cd584 100644 --- a/src/Listener/Traits/IndexTypeTrait.php +++ b/src/Listener/Traits/IndexTypeTrait.php @@ -39,7 +39,7 @@ protected function _getIndexFinderScopes() { $action = $this->_action(); - return $action->config('scaffold.index_finder_scopes') ?: []; + return $action->getConfig('scaffold.index_finder_scopes') ?: []; } /** @@ -52,7 +52,7 @@ protected function _getIndexFormats() { $action = $this->_action(); - return $action->config('scaffold.index_formats') ?: []; + return $action->getConfig('scaffold.index_formats') ?: []; } /** @@ -64,7 +64,7 @@ protected function _getIndexType() { $action = $this->_action(); - $indexType = $action->config('scaffold.index_type'); + $indexType = $action->getConfig('scaffold.index_type'); if (empty($indexType)) { $indexType = 'table'; } @@ -81,9 +81,9 @@ protected function _getIndexTitleField() { $action = $this->_action(); - $field = $action->config('scaffold.index_title_field'); + $field = $action->getConfig('scaffold.index_title_field'); if ($field === null) { - $field = $action->config('scaffold.index_blog_title_field'); + $field = $action->getConfig('scaffold.index_blog_title_field'); if ($field !== null) { $this->deprecatedScaffoldKeyNotice( 'scaffold.index_blog_title_field', @@ -108,9 +108,9 @@ protected function _getIndexBodyField() { $action = $this->_action(); - $field = $action->config('scaffold.index_body_field'); + $field = $action->getConfig('scaffold.index_body_field'); if ($field === null) { - $field = $action->config('scaffold.index_blog_body_field'); + $field = $action->getConfig('scaffold.index_blog_body_field'); if ($field !== null) { $this->deprecatedScaffoldKeyNotice( 'scaffold.index_blog_body_field', @@ -135,7 +135,7 @@ protected function _getIndexImageField() { $action = $this->_action(); - $field = $action->config('scaffold.index_image_field'); + $field = $action->getConfig('scaffold.index_image_field'); if (empty($field)) { $field = 'image'; } @@ -152,7 +152,7 @@ protected function _getIndexGalleryCssClasses() { $action = $this->_action(); - $field = $action->config('scaffold.index_gallery_css_classes'); + $field = $action->getConfig('scaffold.index_gallery_css_classes'); if (empty($field)) { $field = 'col-sm-6 col-md-3'; } diff --git a/src/Listener/Traits/SidebarNavigationTrait.php b/src/Listener/Traits/SidebarNavigationTrait.php index 1a79bbfc..0beee650 100644 --- a/src/Listener/Traits/SidebarNavigationTrait.php +++ b/src/Listener/Traits/SidebarNavigationTrait.php @@ -29,11 +29,11 @@ protected function _getSidebarNavigation() $action = $this->_action(); // deprecated check - if ($action->config('scaffold.disable_sidebar')) { + if ($action->getConfig('scaffold.disable_sidebar')) { return false; } - return $action->config('scaffold.sidebar_navigation'); + return $action->getConfig('scaffold.sidebar_navigation'); } /** diff --git a/src/Listener/Traits/SiteTitleTrait.php b/src/Listener/Traits/SiteTitleTrait.php index 6a0de25c..638b9854 100644 --- a/src/Listener/Traits/SiteTitleTrait.php +++ b/src/Listener/Traits/SiteTitleTrait.php @@ -34,7 +34,7 @@ protected function _getSiteTitle() { $action = $this->_action(); - $title = $action->config('scaffold.site_title'); + $title = $action->getConfig('scaffold.site_title'); if (!empty($title)) { return $title; } @@ -45,7 +45,7 @@ protected function _getSiteTitle() } // deprecated - $title = $action->config('scaffold.brand'); + $title = $action->getConfig('scaffold.brand'); if (!empty($title)) { return $title; } @@ -62,7 +62,7 @@ protected function _getSiteTitleLink() { $action = $this->_action(); - $link = $action->config('scaffold.site_title_link'); + $link = $action->getConfig('scaffold.site_title_link'); if (empty($link)) { $link = ''; } @@ -79,7 +79,7 @@ protected function _getSiteTitleImage() { $action = $this->_action(); - $image = $action->config('scaffold.site_title_image'); + $image = $action->getConfig('scaffold.site_title_image'); if (empty($image)) { $image = ''; } diff --git a/src/Listener/Traits/UtilityNavigationTrait.php b/src/Listener/Traits/UtilityNavigationTrait.php index c81ff035..0bcee792 100644 --- a/src/Listener/Traits/UtilityNavigationTrait.php +++ b/src/Listener/Traits/UtilityNavigationTrait.php @@ -27,7 +27,7 @@ protected function _getUtilityNavigation() { $action = $this->_action(); - $utilityNavigation = $action->config('scaffold.utility_navigation'); + $utilityNavigation = $action->getConfig('scaffold.utility_navigation'); if ($utilityNavigation === null) { $utilityNavigation = [ new MenuItem('Account', ['controller' => 'Users', 'action' => 'account']), diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 6886ffed..072f6156 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -88,7 +88,7 @@ public function beforeRender(Event $event) $this->beforeRenderUtilityNavigation($event); $this->beforeRenderSidebarNavigation($event); $controller = $this->_controller(); - $controller->set('actionConfig', $this->_action()->config()); + $controller->set('actionConfig', $this->_action()->getConfig()); $controller->set('title', $this->_getPageTitle()); $controller->set('breadcrumbs', $this->_getBreadcrumbs()); $associations = $this->associations; @@ -140,12 +140,12 @@ protected function _getPageTitle() { $action = $this->_action(); - $title = $action->config('scaffold.page_title'); + $title = $action->getConfig('scaffold.page_title'); if (!empty($title)) { return $title; } - $scope = $action->config('scope'); + $scope = $action->getConfig('scope'); $request = $this->_request(); $actionName = Inflector::humanize(Inflector::underscore($request->action)); @@ -181,7 +181,7 @@ protected function _getBreadcrumbs() { $action = $this->_action(); - return $action->config('scaffold.breadcrumbs') ?: []; + return $action->getConfig('scaffold.breadcrumbs') ?: []; } /** @@ -198,7 +198,7 @@ protected function _getBreadcrumbs() */ protected function _getRelatedModels($relations = []) { - $models = $this->_action()->config('scaffold.relations'); + $models = $this->_action()->getConfig('scaffold.relations'); if ($models === false) { return []; @@ -219,7 +219,7 @@ protected function _getRelatedModels($relations = []) $models = Hash::normalize($models); - $blacklist = $this->_action()->config('scaffold.relations_blacklist'); + $blacklist = $this->_action()->getConfig('scaffold.relations_blacklist'); if (!empty($blacklist)) { $blacklist = Hash::normalize($blacklist); $models = array_diff_key($models, $blacklist); @@ -241,7 +241,7 @@ protected function _getRelatedModels($relations = []) */ protected function _blacklist() { - return (array)$this->_action()->config('scaffold.fields_blacklist'); + return (array)$this->_action()->getConfig('scaffold.fields_blacklist'); } /** @@ -253,7 +253,7 @@ protected function _getPageVariables() { $table = $this->_table(); $controller = $this->_controller(); - $scope = $this->_action()->config('scope'); + $scope = $this->_action()->getConfig('scope'); $data = [ 'modelClass' => $controller->modelClass, @@ -284,16 +284,16 @@ protected function _getPageVariables() protected function _scaffoldFields(array $associations = []) { $action = $this->_action(); - $scaffoldFields = (array)$action->config('scaffold.fields'); + $scaffoldFields = (array)$action->getConfig('scaffold.fields'); if (!empty($scaffoldFields)) { $scaffoldFields = Hash::normalize($scaffoldFields); } - if (empty($scaffoldFields) || $action->config('scaffold.autoFields')) { + if (empty($scaffoldFields) || $action->getConfig('scaffold.autoFields')) { $cols = $this->_table()->schema()->columns(); $cols = Hash::normalize($cols); - $scope = $action->config('scope'); + $scope = $action->getConfig('scope'); if ($scope === 'entity' && !empty($associations['manyToMany'])) { foreach ($associations['manyToMany'] as $alias => $options) { $cols[sprintf('%s._ids', $options['entities'])] = [ @@ -306,7 +306,7 @@ protected function _scaffoldFields(array $associations = []) } // Check for blacklisted fields - $blacklist = $action->config('scaffold.fields_blacklist'); + $blacklist = $action->getConfig('scaffold.fields_blacklist'); if (!empty($blacklist)) { $scaffoldFields = array_diff_key($scaffoldFields, array_combine($blacklist, $blacklist)); } @@ -320,7 +320,7 @@ protected function _scaffoldFields(array $associations = []) $scaffoldFields[$field] += ['formatter' => null]; } - $fieldSettings = $action->config('scaffold.field_settings'); + $fieldSettings = $action->getConfig('scaffold.field_settings'); if (empty($fieldSettings)) { $fieldSettings = []; } @@ -371,7 +371,7 @@ protected function _getControllerActions() } $actionBlacklist = []; - $groups = $this->_action()->config('scaffold.action_groups') ?: []; + $groups = $this->_action()->getConfig('scaffold.action_groups') ?: []; foreach ($groups as $group) { $group = Hash::normalize($group); foreach ($group as $actionName => $config) { @@ -454,19 +454,19 @@ protected function _getControllerActionConfiguration($actionName, $config) */ protected function _getAllowedActions() { - $actions = $this->_action()->config('scaffold.actions'); + $actions = $this->_action()->getConfig('scaffold.actions'); if ($actions === null) { - $actions = $this->_crud()->config('actions'); + $actions = $this->_crud()->getConfig('actions'); } - $extraActions = $this->_action()->config('scaffold.extra_actions') ?: []; + $extraActions = $this->_action()->getConfig('scaffold.extra_actions') ?: []; $allActions = array_merge( $this->_normalizeActions($actions), $this->_normalizeActions($extraActions) ); - $blacklist = (array)$this->_action()->config('scaffold.actions_blacklist'); + $blacklist = (array)$this->_action()->getConfig('scaffold.actions_blacklist'); $blacklist = array_combine($blacklist, $blacklist); return array_diff_key($allActions, $blacklist); @@ -536,7 +536,7 @@ protected function _associations(array $whitelist = []) $associationConfiguration[$type][$assocKey]['entity'] = Inflector::singularize(Inflector::underscore($assocKey)); $associationConfiguration[$type][$assocKey]['entities'] = Inflector::underscore($assocKey); - $associationConfiguration[$type][$assocKey] = array_merge($associationConfiguration[$type][$assocKey], $this->_action()->config('association.' . $assocKey) ?: []); + $associationConfiguration[$type][$assocKey] = array_merge($associationConfiguration[$type][$assocKey], $this->_action()->getConfig('association.' . $assocKey) ?: []); } return $associationConfiguration; @@ -606,7 +606,7 @@ protected function _getViewBlocks() { $action = $this->_action(); - return $action->config('scaffold.viewblocks') ?: []; + return $action->getConfig('scaffold.viewblocks') ?: []; } /** @@ -618,7 +618,7 @@ protected function _getBulkActions() { $action = $this->_action(); - return $action->config('scaffold.bulk_actions') ?: []; + return $action->getConfig('scaffold.bulk_actions') ?: []; } /** @@ -629,7 +629,7 @@ protected function _getBulkActions() protected function _getActionGroups() { $action = $this->_action(); - $groups = $action->config('scaffold.action_groups') ?: []; + $groups = $action->getConfig('scaffold.action_groups') ?: []; $groupedActions = []; foreach ($groups as $group) { diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index 9974c3d6..1b1daeb2 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -47,7 +47,7 @@ public function afterPaginate(Event $event) return; } - $enabled = $this->config('enabled') ?: !$this->_request()->is('api'); + $enabled = $this->getConfig('enabled') ?: !$this->_request()->is('api'); if (!$enabled) { return; } @@ -63,7 +63,7 @@ public function afterPaginate(Event $event) */ public function fields() { - return $this->config('fields') ?: $this->_deriveFields(); + return $this->getConfig('fields') ?: $this->_deriveFields(); } /** @@ -87,7 +87,7 @@ protected function _deriveFields() $config = $this->_config; foreach ($filters->all() as $filter) { - if ($filter->config('form') === false) { + if ($filter->getConfig('form') === false) { continue; } From d4e417a63abbc75b324a0396f7023d35eed38afe Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:33:01 -0600 Subject: [PATCH 06/24] fix: update deprecated calls to get the displayField --- src/Listener/Traits/IndexTypeTrait.php | 2 +- src/Listener/ViewListener.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Listener/Traits/IndexTypeTrait.php b/src/Listener/Traits/IndexTypeTrait.php index 742cd584..67ebe4ae 100644 --- a/src/Listener/Traits/IndexTypeTrait.php +++ b/src/Listener/Traits/IndexTypeTrait.php @@ -93,7 +93,7 @@ protected function _getIndexTitleField() } if (empty($field)) { - $field = $this->_table()->displayField(); + $field = $this->_table()->getDisplayField(); } return $field; diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 072f6156..24dadc5e 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -165,7 +165,7 @@ protected function _getPageTitle() } $displayFieldValue = $this->_displayFieldValue(); - if ($displayFieldValue === null || $this->_table()->displayField() == $this->_table()->primaryKey()) { + if ($displayFieldValue === null || $this->_table()->getDisplayField() == $this->_table()->primaryKey()) { return sprintf('%s %s #%s', $actionName, $controllerName, $primaryKeyValue); } @@ -258,7 +258,7 @@ protected function _getPageVariables() $data = [ 'modelClass' => $controller->modelClass, 'modelSchema' => $table->schema(), - 'displayField' => $table->displayField(), + 'displayField' => $table->getDisplayField(), 'singularHumanName' => Inflector::humanize(Inflector::underscore(Inflector::singularize($controller->modelClass))), 'pluralHumanName' => Inflector::humanize(Inflector::underscore($controller->name)), 'singularVar' => Inflector::singularize($controller->name), @@ -528,7 +528,7 @@ protected function _associations(array $whitelist = []) $associationConfiguration[$type][$assocKey]['model'] = $assocKey; $associationConfiguration[$type][$assocKey]['type'] = $type; $associationConfiguration[$type][$assocKey]['primaryKey'] = $association->target()->primaryKey(); - $associationConfiguration[$type][$assocKey]['displayField'] = $association->target()->displayField(); + $associationConfiguration[$type][$assocKey]['displayField'] = $association->target()->getDisplayField(); $associationConfiguration[$type][$assocKey]['foreignKey'] = $association->foreignKey(); $associationConfiguration[$type][$assocKey]['propertyName'] = $association->property(); $associationConfiguration[$type][$assocKey]['plugin'] = pluginSplit($association->className())[0]; @@ -563,7 +563,7 @@ protected function _primaryKeyValue() */ protected function _displayFieldValue() { - return $this->_deriveFieldFromContext($this->_table()->displayField()); + return $this->_deriveFieldFromContext($this->_table()->getDisplayField()); } /** From a37b818aa6d9b02aac9710c1b5740fcbc1e91af1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:33:53 -0600 Subject: [PATCH 07/24] fix: update deprecated calls to get the primaryKey --- src/Listener/ViewListener.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 24dadc5e..31ae6681 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -165,7 +165,7 @@ protected function _getPageTitle() } $displayFieldValue = $this->_displayFieldValue(); - if ($displayFieldValue === null || $this->_table()->getDisplayField() == $this->_table()->primaryKey()) { + if ($displayFieldValue === null || $this->_table()->getDisplayField() == $this->_table()->getPrimaryKey()) { return sprintf('%s %s #%s', $actionName, $controllerName, $primaryKeyValue); } @@ -263,7 +263,7 @@ protected function _getPageVariables() 'pluralHumanName' => Inflector::humanize(Inflector::underscore($controller->name)), 'singularVar' => Inflector::singularize($controller->name), 'pluralVar' => Inflector::variable($controller->name), - 'primaryKey' => $table->primaryKey(), + 'primaryKey' => $table->getPrimaryKey(), ]; if ($scope === 'entity') { @@ -527,7 +527,7 @@ protected function _associations(array $whitelist = []) $assocKey = $association->name(); $associationConfiguration[$type][$assocKey]['model'] = $assocKey; $associationConfiguration[$type][$assocKey]['type'] = $type; - $associationConfiguration[$type][$assocKey]['primaryKey'] = $association->target()->primaryKey(); + $associationConfiguration[$type][$assocKey]['primaryKey'] = $association->target()->getPrimaryKey(); $associationConfiguration[$type][$assocKey]['displayField'] = $association->target()->getDisplayField(); $associationConfiguration[$type][$assocKey]['foreignKey'] = $association->foreignKey(); $associationConfiguration[$type][$assocKey]['propertyName'] = $association->property(); @@ -551,7 +551,7 @@ protected function _associations(array $whitelist = []) */ protected function _primaryKeyValue() { - return $this->_deriveFieldFromContext($this->_table()->primaryKey()); + return $this->_deriveFieldFromContext($this->_table()->getPrimaryKey()); } /** From da618b827677a96216c6509994caede25c3896bf Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:37:18 -0600 Subject: [PATCH 08/24] fix: update deprecated calls to get the table schema --- src/Listener/ViewListener.php | 4 ++-- src/Listener/ViewSearchListener.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 31ae6681..b39d9ae0 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -257,7 +257,7 @@ protected function _getPageVariables() $data = [ 'modelClass' => $controller->modelClass, - 'modelSchema' => $table->schema(), + 'modelSchema' => $table->getSchema(), 'displayField' => $table->getDisplayField(), 'singularHumanName' => Inflector::humanize(Inflector::underscore(Inflector::singularize($controller->modelClass))), 'pluralHumanName' => Inflector::humanize(Inflector::underscore($controller->name)), @@ -290,7 +290,7 @@ protected function _scaffoldFields(array $associations = []) } if (empty($scaffoldFields) || $action->getConfig('scaffold.autoFields')) { - $cols = $this->_table()->schema()->columns(); + $cols = $this->_table()->getSchema()->columns(); $cols = Hash::normalize($cols); $scope = $action->getConfig('scope'); diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index 1b1daeb2..30276e6f 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -83,7 +83,7 @@ protected function _deriveFields() } $fields = []; - $schema = $table->schema(); + $schema = $table->getSchema(); $config = $this->_config; foreach ($filters->all() as $filter) { From bf44863265677ca28c60ecb9827abadaff4cd229 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:38:58 -0600 Subject: [PATCH 09/24] fix: update deprecated calls to get request data --- src/Listener/ViewListener.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index b39d9ae0..9dac70aa 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -567,7 +567,7 @@ protected function _displayFieldValue() } /** - * Extract a field value from a either the CakeRequest::$data + * Extract a field value from a either the CakeRequest::getData() * or Controller::$viewVars for the current model + the supplied field * * @param string $field Name of field. @@ -585,8 +585,8 @@ protected function _deriveFieldFromContext($field) } $path = "{$controller->modelClass}.{$field}"; - if (!empty($request->data)) { - $value = Hash::get((array)$request->data, $path); + if (!empty($request->getData())) { + $value = Hash::get((array)$request->getData(), $path); } $singularVar = Inflector::variable($controller->modelClass); From d25e309862e68429ec8478d54bbd00d50537d701 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:40:07 -0600 Subject: [PATCH 10/24] fix: update deprecated calls to get a query argument --- src/View/Helper/CrudViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 05436613..d39a7461 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -284,7 +284,7 @@ public function relation($field) */ public function redirectUrl() { - $redirectUrl = $this->request->query('_redirect_url'); + $redirectUrl = $this->request->getQuery('_redirect_url'); $redirectUrlViewVar = $this->getViewVar('_redirect_url'); if (!empty($redirectUrlViewVar)) { From d12320683d08b0edf584b9440fcac72b0d2b0569 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:40:24 -0600 Subject: [PATCH 11/24] fix: update deprecated calls to get the current relative request url --- src/View/Helper/CrudViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index d39a7461..8e370b0e 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -326,7 +326,7 @@ public function createRelationLink($alias, $relation, $options = []) 'action' => 'add', '?' => [ $relation['foreignKey'] => $this->getViewVar('primaryKeyValue'), - '_redirect_url' => $this->request->here + '_redirect_url' => $this->request->getUri()->getPath() ] ], $options From d916c331def92dd219670c5b497e717ed0e3f8e8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:40:38 -0600 Subject: [PATCH 12/24] fix: update deprecated calls to get a query parameter --- src/View/Helper/CrudViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 8e370b0e..0fcfbda4 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -407,7 +407,7 @@ public function getViewVar($key = null) */ public function getCssClasses() { - $action = (string)$this->request->param('action'); + $action = (string)$this->request->getParam('action'); $pluralVar = $this->getViewVar('pluralVar'); $viewClasses = (array)$this->getViewVar('viewClasses'); $args = func_get_args(); From 7a5b3f6947cb459cdeedfe1d620a6d20c866012e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:44:07 -0600 Subject: [PATCH 13/24] fix: remove unused code passing around an event object --- src/Listener/Traits/FormTypeTrait.php | 3 +-- src/Listener/Traits/IndexTypeTrait.php | 3 +-- src/Listener/Traits/SidebarNavigationTrait.php | 3 +-- src/Listener/Traits/SiteTitleTrait.php | 3 +-- src/Listener/Traits/UtilityNavigationTrait.php | 3 +-- src/Listener/ViewListener.php | 10 +++++----- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php index 038dd0d3..65202fad 100644 --- a/src/Listener/Traits/FormTypeTrait.php +++ b/src/Listener/Traits/FormTypeTrait.php @@ -8,10 +8,9 @@ trait FormTypeTrait /** * beforeRender event * - * @param \Cake\Event\Event $event Event. * @return void */ - protected function beforeRenderFormType(Event $event) + protected function beforeRenderFormType() { $controller = $this->_controller(); diff --git a/src/Listener/Traits/IndexTypeTrait.php b/src/Listener/Traits/IndexTypeTrait.php index 67ebe4ae..3fc1202e 100644 --- a/src/Listener/Traits/IndexTypeTrait.php +++ b/src/Listener/Traits/IndexTypeTrait.php @@ -8,10 +8,9 @@ trait IndexTypeTrait /** * beforeRender event * - * @param \Cake\Event\Event $event Event. * @return void */ - public function beforeRenderIndexType(Event $event) + public function beforeRenderIndexType() { $indexTitleField = $this->_getIndexTitleField(); $indexBodyField = $this->_getIndexBodyField(); diff --git a/src/Listener/Traits/SidebarNavigationTrait.php b/src/Listener/Traits/SidebarNavigationTrait.php index 0beee650..af872abd 100644 --- a/src/Listener/Traits/SidebarNavigationTrait.php +++ b/src/Listener/Traits/SidebarNavigationTrait.php @@ -8,10 +8,9 @@ trait SidebarNavigationTrait /** * beforeRender event * - * @param \Cake\Event\Event $event Event. * @return void */ - public function beforeRenderSidebarNavigation(Event $event) + public function beforeRenderSidebarNavigation() { $controller = $this->_controller(); $sidebarNavigation = $this->_getSidebarNavigation(); diff --git a/src/Listener/Traits/SiteTitleTrait.php b/src/Listener/Traits/SiteTitleTrait.php index 638b9854..4e3cd7a7 100644 --- a/src/Listener/Traits/SiteTitleTrait.php +++ b/src/Listener/Traits/SiteTitleTrait.php @@ -9,10 +9,9 @@ trait SiteTitleTrait /** * beforeRender event * - * @param \Cake\Event\Event $event Event. * @return void */ - public function beforeRenderSiteTitle(Event $event) + public function beforeRenderSiteTitle() { $controller = $this->_controller(); diff --git a/src/Listener/Traits/UtilityNavigationTrait.php b/src/Listener/Traits/UtilityNavigationTrait.php index 0bcee792..0569e9db 100644 --- a/src/Listener/Traits/UtilityNavigationTrait.php +++ b/src/Listener/Traits/UtilityNavigationTrait.php @@ -9,10 +9,9 @@ trait UtilityNavigationTrait /** * beforeRender event * - * @param \Cake\Event\Event $event Event. * @return void */ - public function beforeRenderUtilityNavigation(Event $event) + public function beforeRenderUtilityNavigation() { $controller = $this->_controller(); $controller->set('utilityNavigation', $this->_getUtilityNavigation()); diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 9dac70aa..1814a5db 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -82,11 +82,11 @@ public function beforeRender(Event $event) $this->ensureConfig(); - $this->beforeRenderFormType($event); - $this->beforeRenderIndexType($event); - $this->beforeRenderSiteTitle($event); - $this->beforeRenderUtilityNavigation($event); - $this->beforeRenderSidebarNavigation($event); + $this->beforeRenderFormType(); + $this->beforeRenderIndexType(); + $this->beforeRenderSiteTitle(); + $this->beforeRenderUtilityNavigation(); + $this->beforeRenderSidebarNavigation(); $controller = $this->_controller(); $controller->set('actionConfig', $this->_action()->getConfig()); $controller->set('title', $this->_getPageTitle()); From d6b1c7bb84ad12bae5250995a8f941b6cf296ee8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:50:50 -0600 Subject: [PATCH 14/24] feat: only pass in integer, string, or DateTime --- src/View/Helper/CrudViewHelper.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 0fcfbda4..99b78079 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -177,7 +177,7 @@ public function formatBoolean($field, $value, $options) * Format a date for display * * @param string $field Name of field. - * @param array $value Value of field. + * @param mixed $value Value of field. * @param array $options Options array. * @return string */ @@ -187,7 +187,11 @@ public function formatDate($field, $value, array $options) return $this->Html->label(__d('crud', 'N/A'), 'info'); } - return $this->Time->timeAgoInWords($value, $options); + if (is_int($value) || is_string($value) || $value instanceof DateTime) { + return $this->Time->timeAgoInWords($value, $options); + } + + return $this->Html->label(__d('crud', 'N/A'), 'info'); } /** From 16ca2bfddcf53a557e5a84424de60fc995e38cbb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:52:54 -0600 Subject: [PATCH 15/24] refactor: update docblocks --- src/View/Helper/CrudViewHelper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 99b78079..62b5d590 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -162,7 +162,7 @@ public function columnType($field) * Format a boolean value for display * * @param string $field Name of field. - * @param array $value Value of field. + * @param mixed $value Value of field. * @param array $options Options array * @return string */ @@ -198,7 +198,7 @@ public function formatDate($field, $value, array $options) * Format a time for display * * @param string $field Name of field. - * @param array $value Value of field. + * @param mixed $value Value of field. * @param array $options Options array. * @return string */ @@ -216,7 +216,7 @@ public function formatTime($field, $value, array $options) * Format a string for display * * @param string $field Name of field. - * @param array $value Value of field. + * @param mixed $value Value of field. * @return string */ public function formatString($field, $value) @@ -228,7 +228,7 @@ public function formatString($field, $value) * Format display field value. * * @param string $value Display field value. - * @param array $options Field options. + * @param mixed $options Field options. * @return string */ public function formatDisplayField($value, array $options) From 1b82dd4ef2b6ed260f8d43a0cccc721ff1a420d4 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:53:06 -0600 Subject: [PATCH 16/24] fix: cast value as string --- src/View/Helper/CrudViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 62b5d590..c5041ab5 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -221,7 +221,7 @@ public function formatTime($field, $value, array $options) */ public function formatString($field, $value) { - return h(Text::truncate($value, 200)); + return h(Text::truncate((string)$value, 200)); } /** From 63426a05a6147ba31aeb70d12ad4c6ec1443ca63 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:53:28 -0600 Subject: [PATCH 17/24] fix: do not send value in when its an incorrect type --- src/View/Helper/CrudViewHelper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index c5041ab5..8daf3960 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -209,7 +209,10 @@ public function formatTime($field, $value, array $options) } $format = isset($options['format']) ? $options['format'] : null; - return $this->Time->nice($value, $format); + if (is_int($value) || is_string($value) || $value instanceof DateTime) { + return $this->Time->nice($value, $format); + } + return $this->Html->label(__d('crud', 'N/A'), 'info'); } /** From 127e781f9ebd53179b20d6dd3c64bd42d0980d7c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:55:39 -0600 Subject: [PATCH 18/24] fix: update deprecated calls to get a query parameter --- src/Listener/ViewSearchListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index 30276e6f..3fb76930 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -105,7 +105,7 @@ protected function _deriveFields() 'type' => 'text' ]; - $input['value'] = $request->query($field); + $input['value'] = $request->getQuery($field); if (empty($input['options']) && $schema->columnType($field) === 'boolean') { $input['options'] = ['No', 'Yes']; From 52bbed72e1359f30d224aea8857762e1cf507c90 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:56:00 -0600 Subject: [PATCH 19/24] fix: check type before iterating over fieldKeys --- src/Listener/ViewSearchListener.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index 3fb76930..2c4da3c8 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -130,8 +130,10 @@ protected function _deriveFields() $urlArgs = []; $fieldKeys = isset($input['fields']) ? $input['fields'] : ['id' => $field, 'value' => $field]; - foreach ($fieldKeys as $key => $val) { - $urlArgs[$key] = $val; + if (is_array($fieldKeys)) { + foreach ($fieldKeys as $key => $val) { + $urlArgs[$key] = $val; + } } unset($input['fields']); From cf798eaa664672323b14b538f7372b9cc8c1365c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:56:43 -0600 Subject: [PATCH 20/24] fix: add missing use statement --- src/View/Helper/CrudViewHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 8daf3960..226ab428 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -7,6 +7,7 @@ use Cake\Utility\Text; use Cake\View\Helper; use Cake\View\Helper\FormHelper; +use DateTime; /** * @property \Cake\View\Helper\FormHelper $Form From 5260faa6425fea4a11cc11953a9a18a670f11397 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 18:57:36 -0600 Subject: [PATCH 21/24] fix: remove unused use statements --- src/Listener/Traits/FormTypeTrait.php | 2 -- src/Listener/Traits/IndexTypeTrait.php | 2 -- src/Listener/Traits/SidebarNavigationTrait.php | 2 -- src/Listener/Traits/SiteTitleTrait.php | 1 - src/Listener/Traits/UtilityNavigationTrait.php | 1 - 5 files changed, 8 deletions(-) diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php index 65202fad..37013539 100644 --- a/src/Listener/Traits/FormTypeTrait.php +++ b/src/Listener/Traits/FormTypeTrait.php @@ -1,8 +1,6 @@ Date: Tue, 27 Jun 2017 19:01:56 -0600 Subject: [PATCH 22/24] fix: clarify that we want to check for a non-empty array --- 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 1814a5db..e5709a80 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -513,7 +513,7 @@ protected function _associations(array $whitelist = []) $associations = $table->associations(); $keys = $associations->keys(); - if ($whitelist) { + if (!empty($whitelist)) { $keys = array_intersect($keys, array_map('strtolower', $whitelist)); } foreach ($keys as $associationName) { From 869711185cb5b5d31aa5a79250cbf8b53a22b15d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 19:04:41 -0600 Subject: [PATCH 23/24] fix: reference event to quiet scrutinizer --- src/Listener/ViewSearchListener.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index 2c4da3c8..9ff48a36 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -43,6 +43,7 @@ public function implementedEvents() */ public function afterPaginate(Event $event) { + $event; if (!$this->_table()->behaviors()->has('Search')) { return; } From 80d2f50218a55a7a022616338794add5f64729d3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 27 Jun 2017 19:05:32 -0600 Subject: [PATCH 24/24] fix: add missing newline --- src/View/Helper/CrudViewHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 226ab428..df460c44 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -213,6 +213,7 @@ public function formatTime($field, $value, array $options) if (is_int($value) || is_string($value) || $value instanceof DateTime) { return $this->Time->nice($value, $format); } + return $this->Html->label(__d('crud', 'N/A'), 'info'); }