Commit ced7ee1b by Carsten Brandt

dataprovider: reset orderBy when counting

strict sql dbms like postgres would fail otherwise
parent 9448c3d4
......@@ -158,7 +158,7 @@ class ActiveDataProvider extends BaseDataProvider
throw new InvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.');
}
$query = clone $this->query;
return (int) $query->limit(-1)->offset(-1)->count($this->db);
return (int) $query->limit(-1)->offset(-1)->orderBy([])->count($this->db);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment