Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception has been thrown during the rendering of a template #4084

Closed
andreybolonin opened this issue May 11, 2024 · 3 comments · Fixed by #4085
Closed

An exception has been thrown during the rendering of a template #4084

andreybolonin opened this issue May 11, 2024 · 3 comments · Fixed by #4085

Comments

@andreybolonin
Copy link
Contributor

andreybolonin commented May 11, 2024

An exception has been thrown during the rendering of a template ("Twig\Extension\CoreExtension::constant(): Return value must be of type string, App\Enum\TransactionFinType returned").

Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Twig\Extension\CoreExtension::constant(): Return value must be of type string, App\Enum\TransactionFinType returned").

{{ constant('App\\Enum\\TransactionFinType::FIN_TYPE_RESULT').value }}

After upgrade Twig from 3.9 to 3.10

@ninsuo
Copy link
Contributor

ninsuo commented May 11, 2024

This is due to #4063 which changed the constant method prototype:

public static function constant($constant, $object = null): string

Constants may also return most of the scalar types, arrays, native enums etc.

@fabpot
Copy link
Contributor

fabpot commented May 11, 2024

See #4085

@ninsuo
Copy link
Contributor

ninsuo commented May 11, 2024

aha you are too fast buddy, I'll close #4086 then :)

Have a good weekend!

@fabpot fabpot closed this as completed in 4313162 May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants