{"record":{"id":"fdb2ee90ae029fe7","repo":"yiisoft/yii2","slug":"only-pagination-instance-configuration-array-or-f","errorCode":null,"errorMessage":"Only Pagination instance, configuration array or false is allowed.","messagePattern":"Only Pagination instance, configuration array or false is allowed\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"framework/data/BaseDataProvider.php","lineNumber":230,"sourceCode":"     *   to 'yii\\data\\Pagination'\n     * - an instance of [[Pagination]] or its subclass\n     * - false, if pagination needs to be disabled.\n     *\n     * @throws InvalidArgumentException\n     */\n    public function setPagination($value)\n    {\n        if (is_array($value)) {\n            $config = ['class' => Pagination::className()];\n            if ($this->id !== null) {\n                $config['pageParam'] = $this->id . '-page';\n                $config['pageSizeParam'] = $this->id . '-per-page';\n            }\n            $this->_pagination = Yii::createObject(array_merge($config, $value));\n        } elseif ($value instanceof Pagination || $value === false) {\n            $this->_pagination = $value;\n        } else {\n            throw new InvalidArgumentException('Only Pagination instance, configuration array or false is allowed.');\n        }\n    }\n\n    /**\n     * Returns the sorting object used by this data provider.\n     * @return Sort|bool the sorting object. If this is false, it means the sorting is disabled.\n     */\n    public function getSort()\n    {\n        if ($this->_sort === null) {\n            $this->setSort([]);\n        }\n\n        return $this->_sort;\n    }\n\n    /**\n     * Sets the sort definition for this data provider.","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/data/BaseDataProvider.php#L212-L248","documentation":"Error \"Only Pagination instance, configuration array or false is allowed.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/data/BaseDataProvider.php:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}