简体   繁体   中英

sonata admin Variable “form_helper” does not exist. after twig update

before update (no errors)

symfony/twig-bridge v4.2.8  v4.3.0  Symfony Twig Bridge            
symfony/twig-bundle v4.2.8  v4.3.0  Symfony TwigBundle
twig/extensions     v1.5.4  v1.5.4  Common additional features for Twig that do not directly belong in core
twig/twig           v2.10.0 v2.11.0 Twig, the flexible, fast, and secure template language for PHP

after update (error sonata admin Variable "form_helper" does not exist.)

symfony/twig-bridge v4.3.0  v4.3.0  Symfony Twig Bridge            
symfony/twig-bundle v4.3.0  v4.3.0  Symfony TwigBundle
twig/extensions     v1.5.4  v1.5.4  Common additional features for Twig that do not directly belong in core
twig/twig           v2.11.0 v2.11.0 Twig, the flexible, fast, and secure template language for PHP

error:

Variable "form_helper" does not exist.

in vendor/sonata-project/admin-bundle/src/Resources/views/CRUD/base_edit_form.html.twig (line 63)

sonata:

composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.48.3 3.48.3 The missing Symfony Admin Generator
sonata-project/block-bundle              3.15.0 3.15.0 Symfony SonataBlockBundle
sonata-project/cache                     1.1.1  2.0.1  Cache library
sonata-project/cache-bundle              2.4.2  3.0.1  This bundle provides caching services
sonata-project/core-bundle               3.17.0 3.17.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.5.0  3.0.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.3.0  1.3.0  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.9.0  3.9.0  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
sonata-project/exporter                  2.0.1  2.0.1  Lightweight Exporter library
sonata-project/notification-bundle       3.6.1  3.6.1  Symfony SonataNotificationBundle
sonata-project/page-bundle               3.11.1 3.11.1 This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                2.7.0  2.7.0  Symfony SonataSeoBundle
sonata-project/translation-bundle        2.4.1  2.4.1  SonataTranslationBundle
sonata-project/user-bundle               4.3.0  4.3.0  Symfony SonataUserBundle

I don't know how to correct fix it, but I just reverted

symfony/twig-bridge to v4.2.8
twig/twig to v2.10.0

And all ok for me now. I hope it help you.

I set in composer.json

"symfony/twig-bridge": "4.2.8",
"twig/twig": "2.10"

and updated composer.

This error was caused by an issue at @SonataAdmin/CRUD/base_edit_form.html.twig . It is fixed at v3.49.0 . See the related PR .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM