getgrav/grav · error · RuntimeException

%s relationship has too many objects in it

Error message

%s relationship has too many objects in it

What it means

Error "%s relationship has too many objects in it" thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php:97

     */
    abstract public function count(): int;

    /**
     * @return void
     * @phpstan-pure
     */
    public function check(): void
    {
        $min = $this->options['min'] ?? 0;
        $max = $this->options['max'] ?? 0;

        if ($min || $max) {
            $count = $this->count();
            if ($min && $count < $min) {
                throw new RuntimeException(sprintf('%s relationship has too few objects in it', $this->name));
            }
            if ($max && $count > $max) {
                throw new RuntimeException(sprintf('%s relationship has too many objects in it', $this->name));
            }
        }
    }

    /**
     * @param IdentifierInterface $identifier
     * @return IdentifierInterface
     */
    private function checkIdentifier(IdentifierInterface $identifier): IdentifierInterface
    {
        if ($this->type !== $identifier->getType()) {
            throw new RuntimeException(sprintf('Bad identifier type %s', $identifier->getType()));
        }

        if ($identifier::class !== Identifier::class) {
            return $identifier;
        }

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/4042bf65b0c8eee7. Report an issue: GitHub.