{"record":{"id":"fd65da14fce8fe94","repo":"Leantime/leantime","slug":"cannot-retrieve-project-id-projectid","errorCode":null,"errorMessage":"Cannot retrieve project id '$projectId'","messagePattern":"Cannot retrieve project id '\\$projectId'","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Domain/Canvas/Controllers/Export.php","lineNumber":117,"sourceCode":"     * @param  int  $id  Canvas identifier\n     * @return string XML data\n     *\n     * @throws BindingResolutionException\n     * @throws Exception\n     */\n    protected function export(int $id): string\n    {\n        // getBoard authorizes VIEW against the board's real project and returns false for a\n        // missing/foreign/unauthorized board (export is reachable by arbitrary board id).\n        $canvasAry = $this->blueprintsService->getBoard($id, static::CANVAS_NAME.static::CANVAS_TYPE);\n        ! empty($canvasAry) || throw new Exception(\"Cannot find canvas with id '$id'\");\n\n        $projectId = $canvasAry[0]['projectId'];\n        $recordsAry = $this->blueprintsService->getBoardItems($id, static::CANVAS_NAME.static::CANVAS_TYPE, static::CANVAS_NAME.'canvasitem');\n\n        $projectService = app()->make(ProjectService::class);\n        $projectAry = $projectService->getProject($projectId);\n        ! empty($projectAry) || throw new Exception(\"Cannot retrieve project id '$projectId'\");\n\n        $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>'.PHP_EOL.PHP_EOL;\n        $xml .= $this->xmlExport(static::CANVAS_NAME.static::CANVAS_TYPE, $canvasAry[0]['title'], $recordsAry);\n\n        return $xml;\n    }\n\n    /**\n     * Generates XML markup for canvas data.\n     *\n     * @param  string  $canvasKey  Encoded canvas name\n     * @param  string  $canvasTitle  Canvas title\n     * @param  array  $recordsAry  Array of canvas entry records\n     * @param  int  $indent  Indent level to use\n     * @return string XML data\n     */\n    protected function xmlExport(string $canvasKey, string $canvasTitle, array $recordsAry, int $indent = 0): string\n    {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Canvas/Controllers/Export.php#L99-L135","documentation":"Error \"Cannot retrieve project id '$projectId'\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Canvas/Controllers/Export.php:117 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":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}