-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X-Pagination-Total-Count always = 0 after update composer #355
Comments
Do you mean master or 2.1.5? There's no 2.1.6. |
Yes, it's master. The problem is the pagination of ActiveDataProvider can't get the totalCount so it didnot assign to the Serializer of RestController. |
If you roll back to 2.1.15, does it work? |
Hi, I can also confirm them. I upgraded to 2.1.5 about 4 days ago, since then pagging stopped working. I found totalCount remains 0. I just downgraded to 2.1.4, now it back to work. |
Please show an example of your code how you use the ActiveDataProvider. |
Hi, this is my code below: $dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSizeLimit' => [1, 500000]
],
'sort' => [
'defaultOrder' => [
'debt_no' => SORT_ASC,
]
],
]);
...
$query->addOptions(['track_total_hits' => 'true']);
return $dataProvider; Just simple that, the code worked fine before update new version (from 2.1.5) |
@pctin This issue has been fixed in yiisoft/yii2:2.0.51 composer require 'yiisoft/yii2:>=2.0.51' |
Hi, it did not work with version 2.0.51-52 of 'yiisoft/yii2' |
@samdark my pagination-related changes have been canceled. I canceled them here too. |
@pctin, @tarunjangra would you please try #356? |
After composer update from 2.1.5 to 2.1.6 then ActiveDataProvider return paging with totalCount =0 then X-Pagination-Total-Count for serialize to frontend = 0. The models still return correct.
The text was updated successfully, but these errors were encountered: