Order of array keys doesn't matter, as if was in < 2.0.50
What do you get instead?
Invalid Configuration – yii\base\InvalidConfigException
The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.
in .../vendor/yiisoft/yii2/data/ActiveDataProvider.php at line 164
Additional info
Looks like prepareTotalCount() is called from setPaginator. In older versions that wasn't case and fact that setPagination is called from Yii::configure() before query is set didn't cause problem.
What steps will reproduce the problem?
At any instance of \yii\data\ActiveDataProvider swap pagination and query in array.
Example: Change from:
$dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pageSizeLimit' => false, 'defaultPageSize' => 6, 'forcePageParam' => false, ], ]);
to:$dataProvider = new ActiveDataProvider([ 'pagination' => [ 'pageSizeLimit' => false, 'defaultPageSize' => 6, 'forcePageParam' => false, ], 'query' => $query, ]);
What is the expected result?
Order of array keys doesn't matter, as if was in < 2.0.50
What do you get instead?
Invalid Configuration – yii\base\InvalidConfigException The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses. in .../vendor/yiisoft/yii2/data/ActiveDataProvider.php at line 164
Additional info
Looks like prepareTotalCount() is called from setPaginator. In older versions that wasn't case and fact that setPagination is called from Yii::configure() before query is set didn't cause problem.