【问题标题】:sonata admin Variable "form_helper" does not exist. after twig update奏鸣曲管理员变量“form_helper”不存在。树枝更新后
【发布时间】:2019-10-17 04:47:34
【问题描述】:

更新前(无错误)

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

更新后(错误奏鸣曲管理变量“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

【问题讨论】:

    标签: php symfony twig sonata-admin sonata


    【解决方案1】:

    我不知道如何纠正它,但我只是恢复了

    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"
    

    和更新的作曲家。

    【讨论】:

    • 是的,这对我也有帮助,但对于新版本的奏鸣曲,我们应该修复它。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-08
      • 1970-01-01
      • 2014-12-30
      • 2018-04-30
      • 2020-01-15
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      相关资源
      最近更新 更多