From e41c6e154634cb4a8f52c1de539dcdae2c7154ff Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 10 Jun 2013 15:00:37 +0100 Subject: [PATCH] Issue #2002388 by jeroen12345, toddtomlinson: Rename Views method build_sort() to buildSort(). --- .../views/Plugin/views/style/StylePluginBase.php | 2 +- .../lib/Drupal/views/Plugin/views/style/Table.php | 2 +- .../Drupal/views/Tests/Plugin/StyleTableUnitTest.php | 12 ++++++------ .../views/lib/Drupal/views/ViewExecutable.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php index 76bbb4250be..9235b2ab2a1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php @@ -385,7 +385,7 @@ abstract class StylePluginBase extends PluginBase { * interfere with the sorts. If so it should build; if it returns * any non-TRUE value, normal sorting will NOT be added to the query. */ - function build_sort() { return TRUE; } + public function buildSort() { return TRUE; } /** * Called by the view builder to let the style build a second set of diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php index f6fe7e51792..490cdbb62fb 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php @@ -103,7 +103,7 @@ class Table extends StylePluginBase { /** * {@inheritdoc} */ - function build_sort() { + public function buildSort() { $order = $this->request->query->get('order'); if (!isset($order) && ($this->options['default'] == -1 || empty($this->view->field[$this->options['default']]))) { return TRUE; diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php index 38e67b4fe0f..aa35d364680 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php @@ -44,7 +44,7 @@ class StyleTableUnitTest extends PluginUnitTestBase { $view->initQuery(); $style_plugin = $view->style_plugin; - // Test the build_sort() method. + // Test the buildSort() method. $request = new Request(); $this->container->enterScope('request'); $this->container->set('request', $request); @@ -52,20 +52,20 @@ class StyleTableUnitTest extends PluginUnitTestBase { $style_plugin->options['override'] = FALSE; $style_plugin->options['default'] = ''; - $this->assertTrue($style_plugin->build_sort(), 'If no order and no default order is specified, the normal sort should be used.'); + $this->assertTrue($style_plugin->buildSort(), 'If no order and no default order is specified, the normal sort should be used.'); $style_plugin->options['default'] = 'id'; - $this->assertTrue($style_plugin->build_sort(), 'If no order but a default order is specified, the normal sort should be used.'); + $this->assertTrue($style_plugin->buildSort(), 'If no order but a default order is specified, the normal sort should be used.'); $request->attributes->set('order', $this->randomName()); - $this->assertTrue($style_plugin->build_sort(), 'If no valid field is chosen for order, the normal sort should be used.'); + $this->assertTrue($style_plugin->buildSort(), 'If no valid field is chosen for order, the normal sort should be used.'); $request->attributes->set('order', 'id'); - $this->assertTrue($style_plugin->build_sort(), 'If a valid order is specified but the table is configured to not override, the normal sort should be used.'); + $this->assertTrue($style_plugin->buildSort(), 'If a valid order is specified but the table is configured to not override, the normal sort should be used.'); $style_plugin->options['override'] = TRUE; - $this->assertFalse($style_plugin->build_sort(), 'If a valid order is specified and the table is configured to override, the normal sort should not be used.'); + $this->assertFalse($style_plugin->buildSort(), 'If a valid order is specified and the table is configured to override, the normal sort should not be used.'); // Test the build_sort_post() method. $request = new Request(); diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index a5ca905a17e..263df056864 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1050,7 +1050,7 @@ class ViewExecutable { // Build our sort criteria if we were instructed to do so. if (!empty($this->build_sort)) { // Allow the style handler to deal with sorting. - if ($this->style_plugin->build_sort()) { + if ($this->style_plugin->buildSort()) { $this->_build('sort'); } // allow the plugin to build second sorts as well.