Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

Restful resources pagination with [yii\redis\ActiveRecord] + [yii\data\ActiveDataProvider] problem #84

Open
yii-bot opened this issue Nov 14, 2016 · 2 comments
Labels
ext:redis feature:rest status:to be verified Needs to be reproduced and validated. type:bug Bug

Comments

@yii-bot
Copy link

yii-bot commented Nov 14, 2016

This issue has originally been reported by @phuczeero at yiisoft/yii2#12961.
Moved here by @samdark.


What steps will reproduce the problem?

Token.php

namespace app\models;

class Token extends \yii\redis\ActiveRecord
{
    public function attributes()
    {
        return ['id', 'token', 'user_id'];
    }
}

TokenController.php

namespace app\modules\v2\controllers;
use app\models\Token;

class TransferController extends \yii\rest\Controller
{
    public function actionIndex()
    {
        return new \yii\data\ActiveDataProvider([
            'query' => Token::find()->where([
                'user_id' => Yii::$app->user->id,
            ]),
        ]);
    }
}

What is the expected result?

X-Pagination-Current-Page →1
X-Pagination-Page-Count →2
X-Pagination-Per-Page →20
X-Pagination-Total-Count →30

What do you get instead?

X-Pagination-Current-Page →1
X-Pagination-Page-Count →0
X-Pagination-Per-Page →20
X-Pagination-Total-Count →0

Additional info

Q A
Yii version 2.0.10, master
PHP version 7.0.0
Operating system 64-bit Windows 7 Professional SP1
@jsopra
Copy link

jsopra commented Dec 31, 2018

up

@Geowan
Copy link

Geowan commented Aug 24, 2020

Am also facing the same issue, anyone with a solution for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext:redis feature:rest status:to be verified Needs to be reproduced and validated. type:bug Bug
Projects
None yet
Development

No branches or pull requests

4 participants