Procházet zdrojové kódy

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

Thomas Rabaix před 13 roky
rodič
revize
003d0fd78d
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      Admin/Admin.php

+ 1 - 1
Admin/Admin.php

@@ -638,7 +638,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         $this->configureDatagridFilters($mapper);
         $this->configureDatagridFilters($mapper);
 
 
         // ok, try to limit to add parent filter
         // 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(
             $mapper->add($this->getParentAssociationMapping(), null, array(
                 'field_type' => 'sonata_type_model_reference',
                 'field_type' => 'sonata_type_model_reference',
                 'field_options' => array(
                 'field_options' => array(