{"record":{"id":"2955396310f44ffe","repo":"octobercms/october","slug":"missing-code","errorCode":null,"errorMessage":"Missing code","messagePattern":"Missing code","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/controllers/Files.php","lineNumber":161,"sourceCode":"    public static function getUniqueCode($file)\n    {\n        if (!$file) {\n            return null;\n        }\n\n        $hash = md5($file->file_name . '!' . $file->disk_name);\n        return base64_encode($file->id . '!' . $hash);\n    }\n\n    /**\n     * findFileObject locates a file model based on the unique code.\n     * @param $code string\n     * @return System\\Models\\File\n     */\n    protected function findFileObject($code)\n    {\n        if (!$code) {\n            throw new ApplicationException('Missing code');\n        }\n\n        $parts = explode('!', base64_decode($code));\n        if (count($parts) < 2) {\n            throw new ApplicationException('Invalid code');\n        }\n\n        [$id, $hash] = $parts;\n\n        if (!$file = FileModel::find((int) $id)) {\n            throw new ApplicationException('File not found');\n        }\n\n        // Ensure that the file model utilized for this request is\n        // the one specified in the relationship configuration\n        if ($file->attachment) {\n            $fileModel = $file->attachment->{$file->field}()->getRelated();\n","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/controllers/Files.php#L143-L179","documentation":"Error \"Missing code\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/controllers/Files.php:161 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}