diff -u b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php --- b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php @@ -37,7 +37,7 @@ $this->user_field = $this->query->addField($this->user_table, 'name'); // Add the field. - $this->query->addOrderby(NULL, "LOWER(COALESCE($this->user_table.name, $this->tableAlias.$this->field))", $this->options['order'], $this->tableAlias . '_' . $this->field); + $this->query->addOrderBy(NULL, "LOWER(COALESCE($this->user_table.name, $this->tableAlias.$this->field))", $this->options['order'], $this->tableAlias . '_' . $this->field); } } diff -u b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php --- b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php @@ -22,7 +22,7 @@ public function query() { $this->ensureMyTable(); $this->node_table = $this->query->ensure_table('node', $this->relationship); - $this->field_alias = $this->query->addOrderby(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field); + $this->field_alias = $this->query->addOrderBy(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field); } } diff -u b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/Thread.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/Thread.php --- b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/Thread.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/Thread.php @@ -25,12 +25,12 @@ //Read comment_render() in comment.module for an explanation of the //thinking behind this sort. if ($this->options['order'] == 'DESC') { - $this->query->addOrderby($this->tableAlias, $this->realField, $this->options['order']); + $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']); } else { $alias = $this->tableAlias . '_' . $this->realField . 'asc'; //@todo is this secure? - $this->query->addOrderby(NULL, "SUBSTRING({$this->tableAlias}.{$this->realField}, 1, (LENGTH({$this->tableAlias}.{$this->realField}) - 1))", $this->options['order'], $alias); + $this->query->addOrderBy(NULL, "SUBSTRING({$this->tableAlias}.{$this->realField}, 1, (LENGTH({$this->tableAlias}.{$this->realField}) - 1))", $this->options['order'], $alias); } } diff -u b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php --- b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -260,7 +260,7 @@ // Column is not in query; add a sort on it (without adding the column). $this->aliases[$column] = $this->tableAlias . '.' . $column; } - $this->query->addOrderby(NULL, NULL, $order, $this->aliases[$column]); + $this->query->addOrderBy(NULL, NULL, $order, $this->aliases[$column]); } protected function defineOptions() { diff -u b/core/modules/search/lib/Drupal/search/Plugin/views/sort/Score.php b/core/modules/search/lib/Drupal/search/Plugin/views/sort/Score.php --- b/core/modules/search/lib/Drupal/search/Plugin/views/sort/Score.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/sort/Score.php @@ -27,7 +27,7 @@ foreach (array('filter', 'argument') as $type) { foreach ($this->view->{$type} as $handler) { if (isset($handler->search_score) && $handler->relationship == $this->relationship) { - $this->query->addOrderby(NULL, NULL, $this->options['order'], $handler->search_score); + $this->query->addOrderBy(NULL, NULL, $this->options['order'], $handler->search_score); $this->tableAlias = $handler->tableAlias; return; } diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -873,7 +873,7 @@ * The order selected in the UI. */ public function summarySort($order, $by = NULL) { - $this->query->addOrderby(NULL, NULL, $order, (!empty($by) ? $by : $this->name_alias)); + $this->query->addOrderBy(NULL, NULL, $order, (!empty($by) ? $by : $this->name_alias)); } /** diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -170,7 +170,7 @@ // Since fields should always have themselves already added, just // add a sort on the field. $params = $this->options['group_type'] != 'group' ? array('function' => $this->options['group_type']) : array(); - $this->query->addOrderby(NULL, NULL, $order, $this->field_alias, $params); + $this->query->addOrderBy(NULL, NULL, $order, $this->field_alias, $params); } } diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -948,9 +948,9 @@ * @param $params * Any params that should be passed through to the addField. */ - function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { + public function addOrderBy($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { // Only ensure the table if it's not the special random key. - // @todo: Maybe it would make sense to just add a add_orderby_rand or something similar. + // @todo: Maybe it would make sense to just add an addOrderByRand or something similar. if ($table && $table != 'rand') { $this->ensure_table($table); } @@ -992,7 +992,7 @@ * @param $params * Any params that should be passed through to the add_field. */ - public function addOrderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { + function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { // Only ensure the table if it's not the special random key. // @todo: Maybe it would make sense to just add a add_orderby_rand or something similar. if ($table && $table != 'rand') { diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Date.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Date.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Date.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Date.php @@ -54,7 +54,7 @@ switch ($this->options['granularity']) { case 'second': default: - $this->query->addOrderby($this->tableAlias, $this->realField, $this->options['order']); + $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']); return; case 'minute': $formula = $this->getDateFormat('YmdHi'); @@ -74,7 +74,7 @@ } // Add the field. - $this->query->addOrderby(NULL, $formula, $this->options['order'], $this->tableAlias . '_' . $this->field . '_' . $this->options['granularity']); + $this->query->addOrderBy(NULL, $formula, $this->options['order'], $this->tableAlias . '_' . $this->field . '_' . $this->options['granularity']); } } diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php @@ -39,7 +39,7 @@ 'function' => $this->options['group_type'], ); - $this->query->addOrderby($this->tableAlias, $this->realField, $this->options['order'], NULL, $params); + $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order'], NULL, $params); } public function adminLabel($short = FALSE) { diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php @@ -54,14 +54,14 @@ $join = Views::pluginManager('join')->createInstance('standard', $definition); $menu_links = $this->query->addTable('menu_links', NULL, $join); - $this->query->addOrderby($menu_links, 'weight', $this->options['order']); - $this->query->addOrderby($menu_links, 'link_title', $this->options['order']); + $this->query->addOrderBy($menu_links, 'weight', $this->options['order']); + $this->query->addOrderBy($menu_links, 'link_title', $this->options['order']); } // We need this even when also sorting by weight and title, to make sure // that children of two parents with the same weight and title are // correctly separated. - $this->query->addOrderby($this->tableAlias, $this->field . $i, $this->options['order']); + $this->query->addOrderBy($this->tableAlias, $this->field . $i, $this->options['order']); } } diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Random.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Random.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Random.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/Random.php @@ -17,7 +17,7 @@ class Random extends SortPluginBase { public function query() { - $this->query->addOrderby('rand'); + $this->query->addOrderBy('rand'); } public function buildOptionsForm(&$form, &$form_state) { diff -u b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php --- b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php @@ -34,7 +34,7 @@ public function query() { $this->ensureMyTable(); // Add the field. - $this->query->addOrderby($this->tableAlias, $this->realField, $this->options['order']); + $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']); } protected function defineOptions() { diff -u b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php --- b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php +++ b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php @@ -74,7 +74,7 @@ return $field; } - public function addOrderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { + public function addOrderBy($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) { $this->orderBy = array('field' => $field, 'order' => $order); }