Thomas Rabaix před 9 roky
rodič
revize
5443959ece

+ 2 - 4
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -224,11 +224,9 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
         $definition = $container->getDefinition($serviceId);
         $settings = $container->getParameter('sonata.admin.configuration.admin_services');
 
-        if (method_exists($definition, 'setShared')) {
-            // Symfony 2.8+
+        if (method_exists($definition, 'setShared')) { // Symfony 2.8+
             $definition->setShared(false);
-        } else {
-            // For Symfony <2.8 compatibility
+        } else { // For Symfony <2.8 compatibility
             $definition->setScope(ContainerInterface::SCOPE_PROTOTYPE);
         }
 

+ 6 - 1
DependencyInjection/Compiler/AddFilterTypeCompilerPass.php

@@ -14,6 +14,7 @@ namespace Sonata\AdminBundle\DependencyInjection\Compiler;
 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpKernel\Kernel;
 
 /**
  * Class AddFilterTypeCompilerPass.
@@ -31,7 +32,11 @@ class AddFilterTypeCompilerPass implements CompilerPassInterface
         $types      = array();
 
         foreach ($container->findTaggedServiceIds('sonata.admin.filter.type') as $id => $attributes) {
-            $container->getDefinition($id)->setScope(ContainerInterface::SCOPE_PROTOTYPE);
+            if (method_exists($definition, 'setShared')) { // Symfony 2.8+
+                $definition->setShared(false);
+            } else { // For Symfony <2.8 compatibility
+                $definition->setScope(ContainerInterface::SCOPE_PROTOTYPE);
+            }
 
             foreach ($attributes as $eachTag) {
                 $types[$eachTag['alias']] = $id;

+ 3 - 3
Resources/config/form_types.xml

@@ -41,17 +41,17 @@
 
         <!-- Form Extension -->
         <service id="sonata.admin.form.extension.field" class="Sonata\AdminBundle\Form\Extension\Field\Type\FormTypeFieldExtension">
-            <tag name="form.type_extension" alias="form" />
+            <tag name="form.type_extension" alias="form" extended-type="Symfony\Component\Form\Extension\Core\Type\FormType" />
             <argument />
             <argument />
         </service>
 
         <service id="sonata.admin.form.extension.field.mopa" class="Sonata\AdminBundle\Form\Extension\Field\Type\MopaCompatibilityTypeFieldExtension">
-            <tag name="form.type_extension" alias="form" />
+            <tag name="form.type_extension" alias="form" extended-type="Symfony\Component\Form\Extension\Core\Type\FormType" />
         </service>
 
         <service id="sonata.admin.form.extension.choice" class="Sonata\AdminBundle\Form\Extension\ChoiceTypeExtension">
-            <tag name="form.type_extension" alias="choice" />
+            <tag name="form.type_extension" alias="choice" extended-type="Symfony\Component\Form\Extension\Core\Type\ChoiceType" />
         </service>
 
         <!-- Form Filter Type -->

+ 1 - 1
composer.json

@@ -33,7 +33,7 @@
         "twig/twig": "~1.23",
         "twig/extensions": "~1.0",
         "sonata-project/exporter": "~1.0",
-        "sonata-project/block-bundle": "~2.3,>=2.3.7",
+        "sonata-project/block-bundle": "~2.3,>=2.3.9",
         "sonata-project/core-bundle": "^2.3.10",
         "doctrine/common": "~2.2",
         "doctrine/inflector": "~1.0",