Browse Source

fix error due to the fluid interface

Thomas Rabaix 14 years ago
parent
commit
bdedb46cd3

+ 1 - 1
Resources/views/CRUD/edit_orm_one_to_many.html.twig

@@ -18,7 +18,7 @@ file that was distributed with this source code.
                 {% if inline == 'table' %}
                 {% if inline == 'table' %}
                     <table>
                     <table>
                         <tbody class="sonata-ba-tbody">
                         <tbody class="sonata-ba-tbody">
-                            {{ field_element.setrendered }}
+                            {% set dummy = field_element.setrendered %}
                             {% for nested_group_field_name, nested_group_field in field_element.children %}
                             {% for nested_group_field_name, nested_group_field in field_element.children %}
                                 <tr>
                                 <tr>
                                     {% for field_name, nested_field in nested_group_field.children %}
                                     {% for field_name, nested_field in nested_group_field.children %}

+ 8 - 3
Twig/Extension/SonataAdminExtension.php

@@ -58,7 +58,7 @@ class SonataAdminExtension extends \Twig_Extension
     /**
     /**
      * render a list element from the FieldDescription
      * render a list element from the FieldDescription
      *
      *
-     * @param  $object
+     * @param mixed $object
      * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
      * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
      * @param array $params
      * @param array $params
      * @return
      * @return
@@ -78,7 +78,12 @@ class SonataAdminExtension extends \Twig_Extension
 
 
     public function output(FieldDescriptionInterface $fieldDescription, $content)
     public function output(FieldDescriptionInterface $fieldDescription, $content)
     {
     {
-        return sprintf("\n<!-- fieldName: %s, template: %s -->\n%s\n", $fieldDescription->getFieldName(), $fieldDescription->getTemplate(), $content);
+        return sprintf("\n<!-- START - fieldName: %s, template: %s -->\n%s\n<!-- END - fieldName: %s -->",
+            $fieldDescription->getFieldName(),
+            $fieldDescription->getTemplate(),
+            $content,
+            $fieldDescription->getFieldName()
+        );
     }
     }
 
 
     /**
     /**
@@ -134,7 +139,7 @@ class SonataAdminExtension extends \Twig_Extension
      * @throws InvalidArgumentException
      * @throws InvalidArgumentException
      * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
      * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
      * @param \Sumfony\Component\Form\FormView $formView
      * @param \Sumfony\Component\Form\FormView $formView
-     * @param  $object
+     * @param mixed $object
      * @param array $params
      * @param array $params
      * @return string
      * @return string
      */
      */