{"record":{"id":"c19f99f30fa92c08","repo":"octobercms/october","slug":"when-using-put-with-a-block-you-cannot-have-multi","errorCode":null,"errorMessage":"When using put with a block, you cannot have multiple targets.","messagePattern":"When using put with a block, you cannot have multiple targets\\.","errorType":"exception","errorClass":"TwigErrorSyntax","httpStatus":null,"severity":"error","filePath":"modules/cms/twig/tokenparser/PutTokenParser.php","lineNumber":54,"sourceCode":"        if ($stream->nextIf(TwigToken::OPERATOR_TYPE, '=')) {\n            // Direct assignment mode\n            $values = $this->parseMultitargetExpression();\n            $stream->expect(TwigToken::BLOCK_END_TYPE);\n\n            if (count($names) !== count($values)) {\n                throw new TwigErrorSyntax(\n                    'When using put, you must have the same number of variables and assignments.',\n                    $stream->getCurrent()->getLine(),\n                    $stream->getSourceContext()\n                );\n            }\n        }\n        else {\n            // Capture mode\n            $capture = true;\n\n            if (count($names) > 1) {\n                throw new TwigErrorSyntax(\n                    'When using put with a block, you cannot have multiple targets.',\n                    $stream->getCurrent()->getLine(),\n                    $stream->getSourceContext()\n                );\n            }\n\n            while (!$stream->test(TwigToken::BLOCK_END_TYPE)) {\n                $current = $stream->next();\n                if ($current->test(TwigToken::NAME_TYPE)) {\n                    $options[] = strtolower(trim($current->getValue()));\n                }\n                else {\n                    throw new TwigErrorSyntax(\n                        sprintf('Invalid syntax in the put tag. Line %s', $lineno),\n                        $stream->getCurrent()->getLine(),\n                        $stream->getSourceContext()\n                    );\n                }","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/twig/tokenparser/PutTokenParser.php#L36-L72","documentation":"Error \"When using put with a block, you cannot have multiple targets.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/twig/tokenparser/PutTokenParser.php:54 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"}