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

Error "Records per page must be a positive integer" thrown in octobercms/october.

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)

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.