{"record":{"id":"8abcc0467dd88cca","repo":"getgrav/grav","slug":"bad-identifier-type-s","errorCode":null,"errorMessage":"Bad identifier type %s","messagePattern":"Bad identifier type (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php","lineNumber":109,"sourceCode":"        if ($min || $max) {\n            $count = $this->count();\n            if ($min && $count < $min) {\n                throw new RuntimeException(sprintf('%s relationship has too few objects in it', $this->name));\n            }\n            if ($max && $count > $max) {\n                throw new RuntimeException(sprintf('%s relationship has too many objects in it', $this->name));\n            }\n        }\n    }\n\n    /**\n     * @param IdentifierInterface $identifier\n     * @return IdentifierInterface\n     */\n    private function checkIdentifier(IdentifierInterface $identifier): IdentifierInterface\n    {\n        if ($this->type !== $identifier->getType()) {\n            throw new RuntimeException(sprintf('Bad identifier type %s', $identifier->getType()));\n        }\n\n        if ($identifier::class !== Identifier::class) {\n            return $identifier;\n        }\n\n        if ($this->type === 'media') {\n            return new MediaIdentifier($identifier->getId());\n        }\n\n        return new FlexIdentifier($identifier->getId(), $identifier->getType());\n    }\n\n    private function parseOptions(array $options): void\n    {\n        $this->type = $options['type'];\n        $this->options = $options;\n    }","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php#L91-L127","documentation":"Error \"Bad identifier type %s\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php:109 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}