You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new SqlDataProvider([
'sql' => Companies::find(), // it will react same with any sql. Just use any class, that you have
'pagination' => ['pageSize' => 10]
]);
What is the expected result?
SqlDataProvider class.
What do you get instead?
Call to a member function getQueryBuilder() on string in
vendor/yiisoft/yii2/db/Query.php:157
Stack trace:
#0
vendor/yiisoft/yii2/db/Query.php(481):
yii\db\Query->createCommand() #1
vendor/yiisoft/yii2/db/Query.php(368):
yii\db\Query->queryScalar() #2
vendor/yiisoft/yii2/data/SqlDataProvider.php(170):
yii\db\Query->count() #3
vendor/yiisoft/yii2/data/BaseDataProvider.php(174):
yii\data\SqlDataProvider->prepareTotalCount() #4
vendor/yiisoft/yii2/data/BaseDataProvider.php(225):
yii\data\BaseDataProvider->getTotalCount() #5
vendor/yiisoft/yii2/base/Component.php(180):
yii\data\BaseDataProvider->setPagination() #6
vendor/yiisoft/yii2/BaseYii.php(557):
yii\base\Component->__set() #7
vendor/yiisoft/yii2/base/BaseObject.php(107):
yii\BaseYii::configure()
As far as I understand this issue appeared after version 2.0.50. If I downgrade it to 2.0.48 everything works fine and no issue on my example. After 2.0.50 somehow init function is not called and $this->db is left as string.
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
Create SqlDataProvider, like this:
What is the expected result?
SqlDataProvider class.
What do you get instead?
Additional info
As far as I understand this issue appeared after version 2.0.50. If I downgrade it to 2.0.48 everything works fine and no issue on my example. After 2.0.50 somehow init function is not called and $this->db is left as string.
The text was updated successfully, but these errors were encountered: