소스 검색

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(