{"record":{"id":"f49cc1ea2e1c55e7","repo":"octobercms/october","slug":"data-source-datasourceclass-class-is-not-regi","errorCode":null,"errorMessage":"Data source [{$dataSourceClass}] class is not registered.","messagePattern":"Data source \\[(.+?)\\] class is not registered\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/widgets/Dash.php","lineNumber":637,"sourceCode":"\n        $result = $widget->runHandler(\n            $widgetConfig,\n            $handlerName,\n            $extraData\n        );\n\n        return $result;\n    }\n\n    /**\n     * makeDataSource\n     */\n    protected function makeDataSource(string $dataSourceClass): ReportDataSourceBase\n    {\n        $dataSourceManager = DashManager::instance();\n        $dataSource = $dataSourceManager->getDataSource($dataSourceClass);\n        if (!$dataSource) {\n            throw new SystemException(\"Data source [{$dataSourceClass}] class is not registered.\");\n        }\n\n        return $dataSource;\n    }\n\n    /**\n     * findDimension\n     */\n    protected function findDimension(ReportDataSourceBase $dataSource, string $dimensionCode, bool $strict): ?ReportDimension\n    {\n        return ReportDimension::findDimensionByCode($dataSource->getAvailableDimensions(), $dimensionCode, $strict);\n    }\n\n    /**\n     * listAllMetrics\n     */\n    protected function listAllMetrics(ReportDataSourceBase $dataSource, string $dimensionCode): array\n    {","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/widgets/Dash.php#L619-L655","documentation":"Dash::makeDataSource resolves a report data source class through DashManager::getDataSource, which only knows classes registered with DashManager::registerDataSourceClass. The dashboard module registers three built-ins (SystemReportDataSource, CmsReportDataSource, CmsStatusDataSource) in its ServiceProvider; plugins add their own. A class not in that registry returns null and this SystemException is thrown.","triggerScenarios":"A report widget configuration whose dataSource property names a class that was never registered; referencing a custom data source in a widget config while the plugin that registers it is disabled or not yet installed; misspelled or renamed data source class in a saved dashboard definition after a refactor.","commonSituations":"Deploying a dashboard definition from one environment to another where the data-source plugin is missing; renaming a data source class without updating saved dashboard definitions in the database; copy-pasting example configs from docs that reference a plugin class you have not installed.","solutions":["Register the data source class with DashManager::instance()->registerDataSourceClass(MyDataSource::class, 'My Data') (or via your plugin's registration hook) so getDataSource can find it.","Fix the dataSource value in the widget configuration to the exact fully qualified class name that was registered.","Install/enable the plugin that provides the data source, then reload the dashboard.","List registered sources with DashManager::instance()->listDataSourceClasses() to verify what the manager actually knows."],"exampleFix":"// before - widget config\n{ \"dataSource\": \"MyPlugin\\Report\\DataSource\" }\n\n// after\nclass MyPlugin extends PluginBase\n{\n    public function boot()\n    {\n        \\Dashboard\\Classes\\DashManager::instance()\n            ->registerDataSourceClass(OrdersDataSource::class, 'Orders');\n    }\n}\n// widget config: { \"dataSource\": \"MyPlugin\\Report\\OrdersDataSource\" }","handlingStrategy":"validation","validationCode":"$manager = \\Dashboard\\Classes\\DashManager::instance();\nif (!array_key_exists($dataSourceClass, $manager->listDataSourceClasses())) {\n    throw new \\ValidationException(['dataSource' => \"Data source {$dataSourceClass} is not registered\"]);\n}","typeGuard":"function isRegisteredDataSource(string $class): bool\n{\n    return array_key_exists(\n        $class,\n        \\Dashboard\\Classes\\DashManager::instance()->listDataSourceClasses()\n    );\n}","tryCatchPattern":"try {\n    $source = $this->makeDataSource($class);\n} catch (\\SystemException $e) {\n    // unregistered source: surface which class failed and continue with other reports\n    \\Log::warning($e->getMessage());\n    return null;\n}","preventionTips":["Centralize data source registration in one provider so classes cannot be referenced before boot.","When renaming a data source class, keep an alias registered for old saved definitions or migrate them.","Ship a seeder/migration that revalidates saved widget configs against listDataSourceClasses()."],"tags":["dashboard","datasource","widget-registration","plugin"],"backgroundTag":"datasource-not-registered","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}