diff --git a/Filter/ModelFilter.php b/Filter/ModelFilter.php index 53f5765..cbd200e 100644 --- a/Filter/ModelFilter.php +++ b/Filter/ModelFilter.php @@ -16,6 +16,7 @@ use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; use Sonata\AdminBundle\Form\Type\Filter\ChoiceType; use Sonata\AdminBundle\Form\Type\Filter\DefaultType; +use Sonata\AdminBundle\Form\Type\ModelType; /** * @author Toni Uebernickel @@ -66,7 +67,7 @@ public function getRenderSettings() { return array(DefaultType::class, array( 'operator_type' => 'sonata_type_equal', - 'field_type' => 'model', + 'field_type' => ModelType::class, 'field_options' => $this->getFieldOptions(), 'label' => $this->getLabel(), )); diff --git a/Resources/views/Form/form_admin_fields.html.twig b/Resources/views/Form/form_admin_fields.html.twig index 8d30306..16995b6 100644 --- a/Resources/views/Form/form_admin_fields.html.twig +++ b/Resources/views/Form/form_admin_fields.html.twig @@ -58,12 +58,12 @@ file that was distributed with this source code. {% if sonata_admin.field_description.associationadmin.id(sonata_admin.value) %} - {% render url('sonata_admin_short_object_information', { - 'code': sonata_admin.field_description.associationadmin.code, - 'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value), - 'uniqid': sonata_admin.field_description.associationadmin.uniqid, - 'linkParameters': sonata_admin.field_description.options.link_parameters - }) %} + {{ render(controller('sonata_admin_short_object_information'), { + 'code': sonata_admin.field_description.associationadmin.code, + 'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value), + 'uniqid': sonata_admin.field_description.associationadmin.uniqid, + 'linkParameters': sonata_admin.field_description.options.link_parameters + }) }} {% elseif sonata_admin.field_description.options.placeholder is defined and sonata_admin.field_description.options.placeholder %} {{ sonata_admin.field_description.options.placeholder|trans({}, 'SonataAdminBundle') }}