{"record":{"id":"3e394093c026a0e1","repo":"octobercms/october","slug":"records-per-page-must-be-a-positive-integer","errorCode":null,"errorMessage":"Records per page must be a positive integer","messagePattern":"Records per page must be a positive integer","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/classes/ReportDataPaginationParams.php","lineNumber":21,"sourceCode":"use ApplicationException;\n\n/**\n * ReportDataPaginationParams defines pagination parameters for a data source query\n */\nclass ReportDataPaginationParams\n{\n    private $recordsPerPage;\n    private $currentPage;\n\n    /**\n     * Creates a pagination parameters object.\n     * @param int $recordsPerPage Specifies the number of records per page.\n     * @param int $currentPage Specifies the current page index.\n     */\n    public function __construct(int $recordsPerPage, int $currentPage)\n    {\n        if ($recordsPerPage <= 0) {\n            throw new ApplicationException('Records per page must be a positive integer');\n        }\n\n        if ($currentPage < 0) {\n            throw new ApplicationException('Current page must be zero or a positive integer');\n        }\n\n        $this->recordsPerPage = $recordsPerPage;\n        $this->currentPage = $currentPage;\n    }\n\n    /**\n     * Returns the records per page value\n     * @return int\n     */\n    public function getRecordsPerPage(): int\n    {\n        return $this->recordsPerPage;\n    }","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/classes/ReportDataPaginationParams.php#L3-L39","documentation":"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.","triggerScenarios":"Thrown at modules/dashboard/classes/ReportDataPaginationParams.php:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive integer for recordsPerPage","Clamp client-supplied page sizes to a minimum before constructing the object"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}