Skip to content
Snippets Groups Projects
Commit c3ac6107 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2002390 by x.algorithm, nathangervais, chrisguindon, suhel.rangnekar:...

Issue #2002390 by x.algorithm, nathangervais, chrisguindon, suhel.rangnekar: Rename Views method build_sort_post() to buildSortPost().
parent 1745bd21
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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.
......
......@@ -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)) {
......
......@@ -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();
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment