Loading src/Plugin/views/sort/OrderByDelta.php +5 −5 Original line number Diff line number Diff line Loading @@ -28,16 +28,16 @@ class OrderByDelta extends SortPluginBase { // want to add a order by to a table that does not exists, because if we do // that, a join will be created and we will fall in the same problem that // we are trying to solve here. $has_table = FALSE; $table_name = str_replace('__views_order_by_delta', '', $this->realField); $table_alias = NULL; $table_name = str_replace('__views_order_by_delta', '', $this->field); foreach ($this->query->tables as $table) { if (isset($table[$table_name])) { $has_table = TRUE; $table_alias = $table[$table_name]['alias']; break; } } if ($has_table) { $this->query->addOrderBy($table_name, 'delta', $this->options['order']); if ($table_alias) { $this->query->addOrderBy($table_alias, $this->realField, $this->options['order']); } } Loading views_order_by_delta.views.inc +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ function views_order_by_delta_views_data() { 'sort' => [ 'id' => 'order_by_delta', ], 'real field' => 'delta', ]; } } Loading Loading
src/Plugin/views/sort/OrderByDelta.php +5 −5 Original line number Diff line number Diff line Loading @@ -28,16 +28,16 @@ class OrderByDelta extends SortPluginBase { // want to add a order by to a table that does not exists, because if we do // that, a join will be created and we will fall in the same problem that // we are trying to solve here. $has_table = FALSE; $table_name = str_replace('__views_order_by_delta', '', $this->realField); $table_alias = NULL; $table_name = str_replace('__views_order_by_delta', '', $this->field); foreach ($this->query->tables as $table) { if (isset($table[$table_name])) { $has_table = TRUE; $table_alias = $table[$table_name]['alias']; break; } } if ($has_table) { $this->query->addOrderBy($table_name, 'delta', $this->options['order']); if ($table_alias) { $this->query->addOrderBy($table_alias, $this->realField, $this->options['order']); } } Loading
views_order_by_delta.views.inc +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ function views_order_by_delta_views_data() { 'sort' => [ 'id' => 'order_by_delta', ], 'real field' => 'delta', ]; } } Loading