octobercms/october · error · ApplicationException
Records per page must be a positive integer
Error message
Records per page must be a positive integer
What it means
ApplicationException from the ReportDataPaginationParams constructor: the $recordsPerPage argument, although type-hinted int, was passed as zero or a negative number, which cannot produce a valid LIMIT clause for the data source query. It indicates the caller built pagination parameters with a non-positive page size.
Solutions
- Pass a positive integer for recordsPerPage
- Clamp client-supplied page sizes to a minimum before constructing the object
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/dashboard/classes/ReportDataPaginationParams.php:21 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/3e394093c026a0e1.
Report an issue: GitHub.
Appendix: source
Thrown at modules/dashboard/classes/ReportDataPaginationParams.php:21
use ApplicationException;
/**
* ReportDataPaginationParams defines pagination parameters for a data source query
*/
class ReportDataPaginationParams
{
private $recordsPerPage;
private $currentPage;
/**
* Creates a pagination parameters object.
* @param int $recordsPerPage Specifies the number of records per page.
* @param int $currentPage Specifies the current page index.
*/
public function __construct(int $recordsPerPage, int $currentPage)
{
if ($recordsPerPage <= 0) {
throw new ApplicationException('Records per page must be a positive integer');
}
if ($currentPage < 0) {
throw new ApplicationException('Current page must be zero or a positive integer');
}
$this->recordsPerPage = $recordsPerPage;
$this->currentPage = $currentPage;
}
/**
* Returns the records per page value
* @return int
*/
public function getRecordsPerPage(): int
{
return $this->recordsPerPage;
}View on GitHub (pinned to b608633a7e)