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 8e5c23d..d0a76db 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 @@ -391,7 +391,7 @@ public function buildSort() { return TRUE; } * Called by the view builder to let the style build a second set of * sorts that will come after any other sorts in the view. */ - function build_sort_post() { } + public function buildSortPost() { } /** * Allow the style to do stuff before each row is rendered. 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 490cdbb..05df0ca 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 @@ -121,7 +121,7 @@ public function buildSort() { /** * Add our actual sort criteria */ - function build_sort_post() { + public function buildSortPost() { $query = $this->request->query; $order = $query->get('order'); if (!isset($order)) { 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 aa35d36..6af4636 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTableUnitTest.php @@ -67,7 +67,7 @@ public function testTable() { $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. + // Test the buildSortPost() method. $request = new Request(); $this->container->enterScope('request'); $this->container->set('request', $request); @@ -76,7 +76,7 @@ public function testTable() { $this->prepareView($view); $style_plugin = $view->style_plugin; $style_plugin->options['default'] = ''; - $style_plugin->build_sort_post(); + $style_plugin->buildSortPost(); $this->assertIdentical($style_plugin->order, NULL, 'No sort order was set, when no order was specified and no default column was selected.'); $this->assertIdentical($style_plugin->active, NULL, 'No sort field was set, when no order was specified and no default column was selected.'); $view->destroy(); @@ -86,7 +86,7 @@ public function testTable() { $style_plugin = $view->style_plugin; $style_plugin->options['default'] = 'id'; $style_plugin->options['info']['id']['default_sort_order'] = 'desc'; - $style_plugin->build_sort_post(); + $style_plugin->buildSortPost(); $this->assertIdentical($style_plugin->order, 'desc', 'Fallback to the right default sort order.'); $this->assertIdentical($style_plugin->active, 'id', 'Fallback to the right default sort field.'); $view->destroy(); @@ -97,7 +97,7 @@ public function testTable() { $style_plugin->options['default'] = 'id'; $style_plugin->options['info']['id']['default_sort_order'] = NULL; $style_plugin->options['order'] = 'asc'; - $style_plugin->build_sort_post(); + $style_plugin->buildSortPost(); $this->assertIdentical($style_plugin->order, 'asc', 'Fallback to the right default sort order.'); $this->assertIdentical($style_plugin->active, 'id', 'Fallback to the right default sort field.'); $view->destroy(); @@ -108,7 +108,7 @@ public function testTable() { $request->query->set('sort', 'asc'); $random_name = $this->randomName(); $request->query->set('order', $random_name); - $style_plugin->build_sort_post(); + $style_plugin->buildSortPost(); $this->assertIdentical($style_plugin->order, 'asc', 'No sort order was set, when invalid sort order was specified.'); $this->assertIdentical($style_plugin->active, NULL, 'No sort field was set, when invalid sort order was specified.'); $view->destroy(); @@ -119,7 +119,7 @@ public function testTable() { $style_plugin = $view->style_plugin; $request->query->set('sort', $order); $request->query->set('order', 'id'); - $style_plugin->build_sort_post(); + $style_plugin->buildSortPost(); $this->assertIdentical($style_plugin->order, $order, 'Ensure the right sort order was set.'); $this->assertIdentical($style_plugin->active, 'id', 'Ensure the right order was set.'); $view->destroy(); diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 26bfe5d..61d24cb 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1054,7 +1054,7 @@ public function build($display_id = NULL) { $this->_build('sort'); } // allow the plugin to build second sorts as well. - $this->style_plugin->build_sort_post(); + $this->style_plugin->buildSortPost(); } // Allow area handlers to affect the query.