octobercms/october · error · Twig\Error\SyntaxError

Invalid syntax in the partial tag. Line %s

Error message

Invalid syntax in the partial tag. Line %s

What it means

Error "Invalid syntax in the partial tag. Line %s" thrown in octobercms/october.

Source

Thrown at modules/system/twig/tokenparser/MailPartialTokenParser.php:54

        // Parse partial name (first argument)
        $nodes['__partial_name'] = $this->parser->parseExpression();

        // Parse optional parameters
        while (!$stream->test(TwigToken::BLOCK_END_TYPE)) {
            $current = $stream->next();

            if ($current->test(TwigToken::NAME_TYPE, 'body') && !$stream->test(TwigToken::OPERATOR_TYPE, '=')) {
                $hasBody = true;
                continue;
            }

            if ($current->test(TwigToken::NAME_TYPE)) {
                $paramName = $current->getValue();
                $stream->expect(TwigToken::OPERATOR_TYPE, '=');
                $nodes[$paramName] = $this->parser->parseExpression();
                $paramNames[] = $paramName;
            } else {
                throw new TwigErrorSyntax(
                    sprintf('Invalid syntax in the partial tag. Line %s', $lineno),
                    $stream->getCurrent()->getLine(),
                    $stream->getSourceContext()
                );
            }
        }

        $stream->expect(TwigToken::BLOCK_END_TYPE);

        if ($hasBody) {
            $body = $this->parser->subparse([$this, 'decidePartialEnd'], true);
            $stream->expect(TwigToken::BLOCK_END_TYPE);
        }

        return new MailPartialNode($nodes, $paramNames, $body, $lineno);
    }

    /**

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/system/twig/tokenparser/MailPartialTokenParser.php:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/2be6874d7d5b01bc. Report an issue: GitHub.