Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1016 Bytes

2024-01-16-fix-suggest-paging.md

File metadata and controls

29 lines (23 loc) · 1016 Bytes
title issue author author_email
Fix suggest paging
NEXT-30573
oskroblin Skroblin

Core

  • Changed PagingListingProcessor to also consider preset limit value when processing the request and apply defaults to the criteria

Upgrade Information

Paging processor now accepts preset limit

The PagingListingProcessor now also considers the preset limit value when processing the request. This means that the limit value from the request will be used if it is set, otherwise the preset limit value, of the provided criteria, will be used. If the criteria does not have a preset limit value, the default limit from the system configuration will be used.

$criteria = new Criteria();
$criteria->setLimit(10);

$request = new Request();
$request->query->set('limit', 5);

$processor = new PagingListingProcessor();

$processor->process($criteria, $request);

// $criteria->getLimit() === 5
// $criteria->getLimit() === 10 (if no limit is set in the request)