Loading src/Plugin/views/sort/DraggableViewsSort.php +5 −6 Original line number Diff line number Diff line Loading @@ -115,12 +115,11 @@ class DraggableViewsSort extends SortPluginBase { $this->alias = $this->query->addRelationship($alias, $join, $this->query->view->storage->get('base_table'), $this->relationship); if ($this->options['draggable_views_null_order'] == "before") { $formula = "!ISNULL($this->alias.$this->realField)"; } else { $formula = "ISNULL($this->alias.$this->realField)"; } // We cannot use ISNULL() for compatibility with postgres, so use coalesce // function instead. We use the mix or max php integer as default value based // on if we want those with null before or after. $coalesce_null_value = $this->options['draggable_views_null_order'] == "before" ? PHP_INT_MIN : PHP_INT_MAX; $formula = "COALESCE($this->alias.$this->realField, $coalesce_null_value)"; // We add both to handle ordering of NULL values. $this->query->addOrderBy(NULL, $formula, $this->options['order'], $this->alias . "_" . $this->realField); Loading Loading
src/Plugin/views/sort/DraggableViewsSort.php +5 −6 Original line number Diff line number Diff line Loading @@ -115,12 +115,11 @@ class DraggableViewsSort extends SortPluginBase { $this->alias = $this->query->addRelationship($alias, $join, $this->query->view->storage->get('base_table'), $this->relationship); if ($this->options['draggable_views_null_order'] == "before") { $formula = "!ISNULL($this->alias.$this->realField)"; } else { $formula = "ISNULL($this->alias.$this->realField)"; } // We cannot use ISNULL() for compatibility with postgres, so use coalesce // function instead. We use the mix or max php integer as default value based // on if we want those with null before or after. $coalesce_null_value = $this->options['draggable_views_null_order'] == "before" ? PHP_INT_MIN : PHP_INT_MAX; $formula = "COALESCE($this->alias.$this->realField, $coalesce_null_value)"; // We add both to handle ordering of NULL values. $this->query->addOrderBy(NULL, $formula, $this->options['order'], $this->alias . "_" . $this->realField); Loading