From a3d1dfa9c024b7c6556c5fa281577841818c1859 Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Mon, 14 Apr 2025 19:26:29 +0200 Subject: [PATCH 1/2] Add check for public property --- src/View/Antlers/Language/Runtime/PathDataManager.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/View/Antlers/Language/Runtime/PathDataManager.php b/src/View/Antlers/Language/Runtime/PathDataManager.php index cec692806e..c8a5932391 100644 --- a/src/View/Antlers/Language/Runtime/PathDataManager.php +++ b/src/View/Antlers/Language/Runtime/PathDataManager.php @@ -863,6 +863,13 @@ private function reduceVar($path, $processorData = []) $this->reducedVar = call_user_func_array([$this->reducedVar, Str::camel($varPath)], []); $this->resolvedPath[] = '{method:'.$varPath.'}'; + if ($doCompact) { + $this->compact($path->isFinal); + } + } elseif (is_object($this->reducedVar) && property_exists($this->reducedVar, Str::camel($varPath))) { + $this->reducedVar = $this->reducedVar->{Str::camel($varPath)}; + $this->resolvedPath[] = '{method:'.$varPath.'}'; + if ($doCompact) { $this->compact($path->isFinal); } From 072ed734911d62ac9d9053af8f751bad45f2c957 Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Wed, 16 Apr 2025 06:47:45 +0200 Subject: [PATCH 2/2] Set resolvedPath to property keywords --- src/View/Antlers/Language/Runtime/PathDataManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Antlers/Language/Runtime/PathDataManager.php b/src/View/Antlers/Language/Runtime/PathDataManager.php index c8a5932391..5d6ff4c02f 100644 --- a/src/View/Antlers/Language/Runtime/PathDataManager.php +++ b/src/View/Antlers/Language/Runtime/PathDataManager.php @@ -868,7 +868,7 @@ private function reduceVar($path, $processorData = []) } } elseif (is_object($this->reducedVar) && property_exists($this->reducedVar, Str::camel($varPath))) { $this->reducedVar = $this->reducedVar->{Str::camel($varPath)}; - $this->resolvedPath[] = '{method:'.$varPath.'}'; + $this->resolvedPath[] = '{property:'.$varPath.'}'; if ($doCompact) { $this->compact($path->isFinal);