sonata-project/SonataDoctrineMongoDBAdminBundle

Form/form_admin_fields.htm l.twig miss # # sign

bukn opened this issue · 2 comments

bukn commented

Environment

ubuntu latest version, php internel web server

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle                  3.25.1 3.26.0 The missing Symfony Admin Generator
sonata-project/block-bundle                  3.4.0  3.4.0  Symfony SonataBlockBundle
sonata-project/cache                         1.0.7  1.0.7  Cache library
sonata-project/core-bundle                   3.7.0  3.7.0  Symfony SonataCoreBundle
sonata-project/datagrid-bundle               2.3.0  2.3.0  Symfony SonataDatagridBundle
sonata-project/doctrine-mongodb-admin-bundle 3.0.0  3.0.0  Symfony Sonata / Integrate Doctrine MongoDB ODM into the SonataAdminBundle
sonata-project/doctrine-orm-admin-bundle     3.1.7  3.1.7  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                      1.7.1  1.7.1  Lightweight Exporter library

Symfony packages

$ composer show --latest 'symfony/*'
symfony/monolog-bundle     v3.1.2  v3.1.2  Symfony MonologBundle
symfony/phpunit-bridge     v3.3.13 v3.3.13 Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.6.0  v1.6.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu  v1.6.0  v1.6.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.6.0  v1.6.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56     v1.6.0  v1.6.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.6.0  v1.6.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.6.0  v1.6.0  Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.0  v3.0.0  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.7  v3.0.3  Symfony SwiftmailerBundle
symfony/symfony            v3.3.13 v3.3.13 The Symfony PHP framework

PHP version

$ php -v
PHP 5.6.32 (cli) (built: Nov 20 2017 14:01:32) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Subject

Let me tell the mistake directly:
The file is:
vendor/sonata-project/doctrine-mongodb-admin-bundle/Sonata/DoctrineMongoDBAdminBundle/Resources/views/Form/form_admin_fields.htm
l.twig

LINE 54~59

 54                     {% render url('sonata_admin_short_object_information', {
 55                         'code':     sonata_admin.field_description.associationadmin.code,
 56                         'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value),
 57                         'uniqid':   sonata_admin.field_description.associationadmin.uniqid
 58                         }
 59                     )%}

missed # # at the begining and end of the "render" block
it should be:

 54                     {#% render url('sonata_admin_short_object_information', {
 55                         'code':     sonata_admin.field_description.associationadmin.code,
 56                         'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value),
 57                         'uniqid':   sonata_admin.field_description.associationadmin.uniqid
 58                         }
 59                     )%#}

when I added the two # , there's no error.

I think the right fix is to use

{{ render(url('sonata_admin_short_object_information', {
 55                         'code':     sonata_admin.field_description.associationadmin.code,
 56                         'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value),
 57                         'uniqid':   sonata_admin.field_description.associationadmin.uniqid
 58                         }
 59                     )) }}

This is already fixed