Closed sinkinov-aleksandr closed 4 years ago
The usage of "twig.runtime" service tag is not made in this bundle, but in "sonata-project/core-bundle" (which is being deprecated):
<service id="sonata.core.flashmessage.twig.runtime" class="Sonata\Twig\Extension\FlashMessageRuntime">
<tag name="twig.runtime"/>
<argument type="service" id="sonata.core.flashmessage.manager"/>
</service>
The current replacement is provided by "sonata-project/twig-extensions", which doesn't have "symfony/twig-bundle" as an explicit requirement; so I think we must work on that.
Should I create any other issue?
Should I create any other issue?
Yes please.
Please keep in mind, that we can't fix this on the twig-extensions repo, 'cause this conflicts with the latest CoreBundle: https://github.com/sonata-project/twig-extensions/blob/1.x/composer.json#L32
I don't think this issue is present anymore
Issue is still present
sonata-project/block-bundle 3.19.0 Symfony SonataBlockBundle
sonata-project/cache 2.0.1 Cache library
sonata-project/core-bundle 3.17.2 Symfony SonataCoreBundle (abandoned)
sonata-project/datagrid-bundle 2.4.0 Symfony SonataDatagridBundle
sonata-project/doctrine-extensions 1.5.1 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.12.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle 2.5.0 Symfony SonataEasyExtendsBundle
sonata-project/exporter 2.3.0 Lightweight Exporter library
sonata-project/google-authenticator 2.2.0 Library to integrate Google Authenticator into a PHP project
sonata-project/translation-bundle 2.4.2 SonataTranslationBundle
sonata-project/user-bundle 3.6.0 Symfony SonataUserBundle
Does anyone have a resolution on how to solve it ? I've updated to the latest as of this post date (3.x version) and get the same error as described in the OP.
Hello! When I open the sonata admin page i've got an error
Unable to load the "Sonata\Twig\Extension\FlashMessageRuntime runtime
. You might the bug fixed in issue #607 but the reason is twig runtimes is empty because tag twig.runtime was added since 3.2.x version https://github.com/symfony/symfony/commit/7fc174b0ad24eaf7189cd8621ceb2a56895dea45 and in 2.8.x versions a code which add sonata.core.flashmessage.twig.runtime to Twig\Environment (by called addRuntimeLoader) not exist.Environment
Sonata packages
Symfony packages
PHP version
Subject
[1] Twig\Error\RuntimeError: Unable to load the "Sonata\Twig\Extension\FlashMessageRuntime" runtime. at n/a in /Users/admin/www/billing/vendor/sonata-project/core-bundle/src/CoreBundle/Resources/views/FlashMessage/render.html.twig line 12
Steps to reproduce
Expected results
Actual results