Skip to content

Conversation

GrimpEreau
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #3992
License MIT
Doc PR n/a

@soyuka soyuka added this to the 2.6.2 milestone Feb 2, 2021
$container->setParameter('api_platform.collection.order', $config['defaults']['order'] ?? $config['collection']['order']);
$container->setParameter('api_platform.collection.order_parameter_name', $config['collection']['order_parameter_name']);
$container->setParameter('api_platform.collection.pagination.enabled', $this->isConfigEnabled($container, $config['defaults']['pagination_enabled'] ?? $config['collection']['pagination']));
$container->setParameter('api_platform.collection.pagination.enabled', $config['api_platform']['defaults'] ?? $this->isConfigEnabled($container, $config['collection']['pagination']));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$container->setParameter('api_platform.collection.pagination.enabled', $config['api_platform']['defaults'] ?? $this->isConfigEnabled($container, $config['collection']['pagination']));
$container->setParameter('api_platform.collection.pagination.enabled', $config['api_platform']['defaults']['pagination_enabled'] ?? $this->isConfigEnabled($container, $config['collection']['pagination']));

'attributes' => [
'pagination' => true,
],
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be:

 $config['api_platform']['defaults'] = [
            'pagination_enabled' => true
        ];

@GrimpEreau GrimpEreau changed the base branch from main to 2.6 February 3, 2021 12:15
@soyuka soyuka merged commit d65b136 into api-platform:2.6 Feb 3, 2021
@soyuka
Copy link
Member

soyuka commented Feb 3, 2021

thanks @GrimpEreau !

cacahouwete pushed a commit to cacahouwete/core that referenced this pull request Feb 8, 2021
* fix pagination defaults and add tests

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug when using defaults.pagination_enabled to configure pagination

3 participants