浏览代码

Fix blank filter being display when the Admin declare an parentAssociationMapping field

Thomas Rabaix 13 年之前
父节点
当前提交
003d0fd78d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Admin/Admin.php

+ 1 - 1
Admin/Admin.php

@@ -638,7 +638,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         $this->configureDatagridFilters($mapper);
 
         // ok, try to limit to add parent filter
-        if ($this->getParentAssociationMapping()) {
+        if ($this->isChild() && $this->getParentAssociationMapping() && !$mapper->has($this->getParentAssociationMapping())) {
             $mapper->add($this->getParentAssociationMapping(), null, array(
                 'field_type' => 'sonata_type_model_reference',
                 'field_options' => array(