Skip to content

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

Closed
@ALameLlama

Description

@ALameLlama

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: mediumMedium

    Type

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions