sonata admin 变量 "form_helper" 不存在。树枝更新后

sonata admin Variable "form_helper" does not exist. after twig update

更新前(无错误)

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

更新后(错误sonata admin变量"form_helper"不存在。)

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

错误:

Variable "form_helper" does not exist.

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

奏鸣曲:

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

我不知道如何更正它,但我刚刚恢复了

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

现在对我来说一切都很好。希望对你有帮助。

我设置在composer.json

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

并更新了作曲家。

此错误是由 @SonataAdmin/CRUD/base_edit_form.html.twig 上的问题引起的。固定为 v3.49.0. See the related PR.