{"record":{"id":"ea7f6450888eba2e","repo":"Leantime/leantime","slug":"32602","errorCode":"-32602","errorMessage":"userHash and calendar hash are required","messagePattern":"userHash and calendar hash are required","errorType":"validation","errorClass":"Leantime\\Core\\Exceptions\\MissingParameterException","httpStatus":422,"severity":"error","filePath":"app/Domain/Calendar/Services/Calendar.php","lineNumber":395,"sourceCode":"\n    /**\n     * Retrieves iCal calendar by user hash and calendar hash.\n     *\n     * @param  string  $userHash  The hash of the user.\n     * @param  string  $calHash  The hash of the calendar.\n     * @return IcalCalendar The iCal calendar generated from the calendar events.\n     *\n     * @throws MissingParameterException If either user hash or calendar hash is empty.\n     *\n     * Not @api: served by the PUBLIC, hash-authenticated /calendar/ical route (no session). The\n     * userHash+calHash secrets ARE the credential; exposing it over JSON-RPC would let a caller\n     * brute-force feeds. The Ical controller calls it internally.\n     */\n    public function getIcalByHash(string $userHash, string $calHash): IcalCalendar\n    {\n\n        if (empty($userHash) || empty($calHash)) {\n            throw new MissingParameterException('userHash and calendar hash are required');\n        }\n\n        $calendarEvents = $this->calendarRepo->getCalendarBySecretHash($userHash, $calHash);\n\n        if (! $calendarEvents) {\n            throw new \\Exception('Calendar could not be retrieved');\n        }\n\n        $eventObjects = [];\n        // Create array of event objects for ical generator\n        foreach ($calendarEvents as $event) {\n\n            try {\n\n                $description = str_replace(\"\\r\\n\", '\\\\n', strip_tags($event['description']));\n\n                $currentEvent = IcalEvent::create()\n                    ->image(BASE_URL.'/dist/images/favicon.png', 'image/png', Display::badge())","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Calendar/Services/Calendar.php#L377-L413","documentation":"Error \"userHash and calendar hash are required\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Calendar/Services/Calendar.php:395 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"}