Explorar o código

Merge pull request #4247 from davidgorges/patch-1

update recipe to use request_stack
Christian Gripp %!s(int64=8) %!d(string=hai) anos
pai
achega
5afcf8d663
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Resources/doc/cookbook/recipe_image_previews.rst

+ 1 - 1
Resources/doc/cookbook/recipe_image_previews.rst

@@ -58,7 +58,7 @@ we are manipulating form fields we do this from within ``ImageAdmin::configureFo
             if ($image && ($webPath = $image->getWebPath())) {
                 // get the container so the full path to the image can be set
                 $container = $this->getConfigurationPool()->getContainer();
-                $fullPath = $container->get('request')->getBasePath().'/'.$webPath;
+                $fullPath = $container->get('request_stack')->getCurrentRequest()->getBasePath().'/'.$webPath;
 
                 // add a 'help' option containing the preview's img tag
                 $fileFieldOptions['help'] = '<img src="'.$fullPath.'" class="admin-preview" />';