Explorar o código

Fix BC issue on AclMatrixType

core23 %!s(int64=8) %!d(string=hai) anos
pai
achega
756ffca010
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      Util/AdminObjectAclManipulator.php

+ 6 - 1
Util/AdminObjectAclManipulator.php

@@ -272,7 +272,12 @@ class AdminObjectAclManipulator
                 );
             }
 
-            $formBuilder->add($key, new AclMatrixType(), array('permissions' => $permissions, 'acl_value' => $aclValue));
+            // NEXT_MAJOR: remove when dropping Symfony <2.8 support
+            $type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix') ?
+                'Sonata\AdminBundle\Form\Type\AclMatrixType' :
+                new AclMatrixType();
+
+            $formBuilder->add($key, $type, array('permissions' => $permissions, 'acl_value' => $aclValue));
         }
 
         return $formBuilder->getForm();