From 0908e1bbd6fa1edc5b7938586253aa1e8593bcdf Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Fri, 24 Jul 2026 16:30:43 +0200 Subject: [PATCH 1/3] Add failing test for pipe + shorthand modifier regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reproduces the case reported in https://github.com/statamic/cms/pull/14892#issuecomment-5052152507 — a standalone (non-paired) tag mixing pipe and shorthand modifier syntax used to render fine, but now throws a parser error. --- tests/Antlers/Runtime/CoreModifiersTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Antlers/Runtime/CoreModifiersTest.php b/tests/Antlers/Runtime/CoreModifiersTest.php index 64293910821..2d4adc07ca9 100644 --- a/tests/Antlers/Runtime/CoreModifiersTest.php +++ b/tests/Antlers/Runtime/CoreModifiersTest.php @@ -586,6 +586,14 @@ public function test_rawurlencode_except_slashes() { $this->assertSame('please%20and%20thank%20you/Mommy', $this->resultOf('{{ test_url_encode | rawurlencode_except_slashes }}')); } + + public function test_pipe_with_shorthand_modifier_parameter_on_standalone_tag_still_renders() + { + // https://github.com/statamic/cms/pull/14892#issuecomment-5052152507 + $data = ['last_modified' => Carbon::parse('2026-01-01 00:00:00')]; + + $this->assertSame('1767225600', $this->renderString('{{ last_modified | format="U" }}', $data, true)); + } } class SimpleEntryObject implements Arrayable From 848f3e92bf7e247576576788b43963ae6a50810b Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Fri, 24 Jul 2026 16:31:04 +0200 Subject: [PATCH 2/3] Revert "[6.x] Throw parser error when mixing pipe and shorthand modifier syntax (#14892)" This reverts commit 6a81472ed89d423d3d40d9f4fadfddbce6bdc893. --- .../Language/Errors/AntlersErrorCodes.php | 1 - .../Language/Parser/AntlersNodeParser.php | 13 ----------- tests/Antlers/Parser/ParserErrorsTest.php | 22 ------------------- 3 files changed, 36 deletions(-) diff --git a/src/View/Antlers/Language/Errors/AntlersErrorCodes.php b/src/View/Antlers/Language/Errors/AntlersErrorCodes.php index ea92b3e33e0..77b41a6b8c0 100644 --- a/src/View/Antlers/Language/Errors/AntlersErrorCodes.php +++ b/src/View/Antlers/Language/Errors/AntlersErrorCodes.php @@ -133,5 +133,4 @@ class AntlersErrorCodes const TYPE_UNEXPECTED_EOI_PARSING_SHORTHAND_PARAMETER = 'ANTLR_133'; const TYPE_DIRECTIVE_MISSING_ARGUMENTS = 'ANTLR_134'; const RUNTIME_METHOD_CALL_USER_CONTENT = 'ANTLR_135'; - const TYPE_MIXED_MODIFIER_STYLES = 'ANTLR_136'; } diff --git a/src/View/Antlers/Language/Parser/AntlersNodeParser.php b/src/View/Antlers/Language/Parser/AntlersNodeParser.php index 85f63c695e7..3addbb5cdf4 100644 --- a/src/View/Antlers/Language/Parser/AntlersNodeParser.php +++ b/src/View/Antlers/Language/Parser/AntlersNodeParser.php @@ -15,7 +15,6 @@ use Statamic\View\Antlers\Language\Nodes\DirectiveNode; use Statamic\View\Antlers\Language\Nodes\Parameters\ParameterNode; use Statamic\View\Antlers\Language\Nodes\RecursiveNode; -use Statamic\View\Antlers\Language\Nodes\Structures\ModifierSeparator; use Statamic\View\Antlers\Language\Nodes\TagIdentifier; use Statamic\View\Antlers\Language\Runtime\Sandbox\TypeCoercion; use Statamic\View\Antlers\Language\Utilities\StringUtilities; @@ -273,18 +272,6 @@ public function parseNode(AntlersNode $node) $node->runtimeNodes = $runtimeNodes; - if ($node->hasParameters) { - foreach ($runtimeNodes as $runtimeNode) { - if ($runtimeNode instanceof ModifierSeparator) { - throw ErrorFactory::makeSyntaxError( - AntlersErrorCodes::TYPE_MIXED_MODIFIER_STYLES, - $node, - 'Cannot mix pipe and shorthand parameter modifier styles on the same expression. Use either "| modifier(\'value\')" or "modifier=\'value\'", but not both.' - ); - } - } - } - $trimmedInner = trim($node->content); if (ConditionPairAnalyzer::isConditionalStructure($node) && $node->name->name != 'else' && count($runtimeNodes) == 0 diff --git a/tests/Antlers/Parser/ParserErrorsTest.php b/tests/Antlers/Parser/ParserErrorsTest.php index cbbe6624190..ff79c841007 100644 --- a/tests/Antlers/Parser/ParserErrorsTest.php +++ b/tests/Antlers/Parser/ParserErrorsTest.php @@ -214,26 +214,4 @@ public function test_incomplete_shorthand_parameters_throws_error_two() { $this->assertThrowsParserError('{{ tag_name :$}}'); } - - public function test_mixed_pipe_and_shorthand_modifier_throws_exception() - { - $this->assertThrowsParserError('{{ active_platforms | sort="value" }}'); - } - - public function test_mixed_pipe_and_shorthand_modifier_paired_throws_exception() - { - $this->assertThrowsParserError('{{ active_platforms | sort="value" }}items{{ /active_platforms }}'); - } - - public function test_mixed_pipe_and_shorthand_with_registered_modifier_throws_exception() - { - $this->assertThrowsParserError('{{ thing | upper="value" }}'); - } - - public function test_pipe_function_modifier_still_renders() - { - $data = ['items' => [['value' => 'Zebra'], ['value' => 'Apple'], ['value' => 'Mango']]]; - $result = $this->renderString('{{ items | sort("value") }}{{ value }}{{ /items }}', $data, true); - $this->assertSame('applemangozebra', strtolower($result)); - } } From 1043f1de8d44d532ec0cee0e0d9bc8fdbac49dd8 Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Fri, 24 Jul 2026 16:51:52 +0200 Subject: [PATCH 3/3] Drop comment --- tests/Antlers/Runtime/CoreModifiersTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Antlers/Runtime/CoreModifiersTest.php b/tests/Antlers/Runtime/CoreModifiersTest.php index 2d4adc07ca9..981f1bfa430 100644 --- a/tests/Antlers/Runtime/CoreModifiersTest.php +++ b/tests/Antlers/Runtime/CoreModifiersTest.php @@ -589,7 +589,6 @@ public function test_rawurlencode_except_slashes() public function test_pipe_with_shorthand_modifier_parameter_on_standalone_tag_still_renders() { - // https://github.com/statamic/cms/pull/14892#issuecomment-5052152507 $data = ['last_modified' => Carbon::parse('2026-01-01 00:00:00')]; $this->assertSame('1767225600', $this->renderString('{{ last_modified | format="U" }}', $data, true));