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

[BUG]: Paginator Model Adapter Incorrect total items when grouped #16042

Closed
ALameLlama opened this issue Aug 5, 2022 · 1 comment
Closed
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@ALameLlama
Copy link
Contributor

Describe the bug
This is currently always returning 1 for total items when grouped which also breaks the last page/total page count as well.

To Reproduce
Steps to reproduce the behavior:
Create a model paginator without passing a group in the parameters and then one with group.

    $paginator = new \Phalcon\Paginator\Adapter\Model([
        'model' => Model::class,
        'parameters' => [
            'type IN ({type:array})',
            'bind' => [
                'type' => [
                    Model::TYPE_1,
                    Model::TYPE_2,
                ],
            ],
            'group' => 'type'
        ]
    ]);

Since this is grouped by type and 2 types are provided, you'd expect it to return total items as 2 but this will return 1

Details

  • Phalcon version: 5.0.0RC3
  • PHP Version: 7.4.30
  • Operating System: Ubuntu 20.04.4
  • Installation type: Any
  • Zephir version (if any): NA
  • Server: Apache
@ALameLlama ALameLlama added bug A bug report status: unverified Unverified labels Aug 5, 2022
@niden niden added status: medium Medium 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels Aug 5, 2022
@niden niden added this to Working on it in Phalcon Roadmap Aug 5, 2022
@niden
Copy link
Sponsor Member

niden commented Aug 5, 2022

Resolved in #16043

@niden niden closed this as completed Aug 5, 2022
Phalcon Roadmap automation moved this from Working on it to Implemented Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Archived in project
Phalcon Roadmap
  
Implemented
Development

No branches or pull requests

2 participants