We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b0255d commit c9a3728Copy full SHA for c9a3728
src/helpers/Template.php
@@ -12,6 +12,7 @@
12
use craft\db\Paginator;
13
use craft\web\twig\variables\Paginate;
14
use craft\web\View;
15
+use Stringable;
16
use Twig\Environment;
17
use Twig\Error\RuntimeError;
18
use Twig\Extension\CoreExtension;
@@ -145,6 +146,11 @@ public static function attribute(
145
146
}
147
148
try {
149
+ // workaround for https://github.com/twigphp/Twig/issues/4701
150
+ if ($type !== TwigTemplate::METHOD_CALL && $item instanceof Stringable) {
151
+ $item = (string) $item;
152
+ }
153
+
154
return CoreExtension::getAttribute(
155
$env,
156
$source,
0 commit comments