deprecated warnings when using sonata admin bundle

帅比萌擦擦* 提交于 2020-01-05 04:40:21

问题


I am using symfony2.7 with sonata admin doctrine orm bundle, I followed the official install instructions, works fine except one thing. At every request I get the following debrecated warnings, and I dont know how to eliminate it.

Date:   2016-10-18 08:58:28
Fatal: array(
    ['type'] => 16384, 
    ['message'] => 'This class is deprecated since 3.2 and will be removed with the 4.0 release.Use Sonata\BlockBundle\Block\Block\Service\AbstractBlockService instead.', 
    ['file'] => '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev/classes.php', 
    ['line'] => 8575, 
)

edit: I attached a stack trace

1 in classes.php line 9354
2 at require_once() in ClassCollectionLoader.php line 96
3 at ClassCollectionLoader::load(array('Symfony\Bundle\FrameworkBundle\EventListener\SessionListener', 'Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage', 'Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage', 'Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler', 'Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy', 'Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', 'Symfony\Component\HttpFoundation\Session\Session', 'Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables', 'Symfony\Bundle\FrameworkBundle\Templating\TemplateReference', 'Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser', 'Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator', 'Symfony\Component\Routing\Generator\UrlGenerator', 'Symfony\Component\Routing\RequestContext', 'Symfony\Component\Routing\Router', 'Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher', 'Symfony\Bundle\FrameworkBundle\Routing\Router', 'Symfony\Component\Config\FileLocator', 'Symfony\Component\Debug\ErrorHandler', 'Symfony\Component\EventDispatcher\Event', 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher', 'Symfony\Component\HttpKernel\EventListener\ResponseListener', 'Symfony\Component\HttpKernel\EventListener\RouterListener', 'Symfony\Component\HttpKernel\Controller\ControllerResolver', 'Symfony\Component\HttpKernel\Event\KernelEvent', 'Symfony\Component\HttpKernel\Event\FilterControllerEvent', 'Symfony\Component\HttpKernel\Event\FilterResponseEvent', 'Symfony\Component\HttpKernel\Event\GetResponseEvent', 'Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent', 'Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent', 'Symfony\Component\HttpKernel\KernelEvents', 'Symfony\Component\HttpKernel\Config\FileLocator', 'Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser', 'Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver', 'Symfony\Component\Security\Http\AccessMap', 'Symfony\Component\Security\Http\Firewall', 'Symfony\Component\Security\Core\User\UserProviderInterface', 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage', 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager', 'Symfony\Component\Security\Core\Authorization\AuthorizationChecker', 'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface', 'Symfony\Bundle\SecurityBundle\Security\FirewallMap', 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', 'Symfony\Component\HttpFoundation\RequestMatcher', 'Twig_Environment', 'Twig_Extension', 'Twig_Extension_Core', 'Twig_Extension_Escaper', 'Twig_Extension_Optimizer', 'Twig_LoaderInterface', 'Twig_Markup', 'Twig_Template', 'Monolog\Formatter\FormatterInterface', 'Monolog\Formatter\LineFormatter', 'Monolog\Handler\HandlerInterface', 'Monolog\Handler\AbstractHandler', 'Monolog\Handler\AbstractProcessingHandler', 'Monolog\Handler\StreamHandler', 'Monolog\Handler\FingersCrossedHandler', 'Monolog\Handler\FilterHandler', 'Monolog\Handler\TestHandler', 'Monolog\Logger', 'Symfony\Bridge\Monolog\Logger', 'Symfony\Bridge\Monolog\Handler\DebugHandler', 'Monolog\Handler\FingersCrossed\ActivationStrategyInterface', 'Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy', 'Symfony\Bundle\AsseticBundle\DefaultValueSupplier', 'Symfony\Bundle\AsseticBundle\Factory\AssetFactory', 'Doctrine\Common\Annotations\DocLexer', 'Doctrine\Common\Annotations\FileCacheReader', 'Doctrine\Common\Annotations\PhpParser', 'Doctrine\Common\Annotations\Reader', 'Doctrine\Common\Lexer', 'Doctrine\Common\Persistence\ConnectionRegistry', 'Doctrine\Common\Persistence\Proxy', 'Doctrine\Common\Util\ClassUtils', 'Doctrine\Bundle\DoctrineBundle\Registry', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener', 'Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationAnnotation', 'Sonata\CoreBundle\Form\Type\BooleanType', 'Sonata\CoreBundle\Form\Type\CollectionType', 'Sonata\CoreBundle\Form\Type\DateRangeType', 'Sonata\CoreBundle\Form\Type\DateTimeRangeType', 'Sonata\CoreBundle\Form\Type\EqualType', 'Sonata\CoreBundle\Form\Type\ImmutableArrayType', 'Sonata\CoreBundle\Form\Type\TranslatableChoiceType', 'Sonata\BlockBundle\Block\BaseBlockService', 'Sonata\BlockBundle\Block\BlockLoaderChain', 'Sonata\BlockBundle\Block\BlockLoaderInterface', 'Sonata\BlockBundle\Block\BlockRenderer', 'Sonata\BlockBundle\Block\BlockRendererInterface', 'Sonata\BlockBundle\Block\BlockServiceInterface', 'Sonata\BlockBundle\Block\BlockServiceManager', 'Sonata\BlockBundle\Block\BlockServiceManagerInterface', 'Sonata\BlockBundle\Block\Loader\ServiceLoader', 'Sonata\BlockBundle\Block\Service\EmptyBlockService', 'Sonata\BlockBundle\Block\Service\RssBlockService', 'Sonata\BlockBundle\Block\Service\MenuBlockService', 'Sonata\BlockBundle\Block\Service\TextBlockService', 'Sonata\BlockBundle\Exception\BlockExceptionInterface', 'Sonata\BlockBundle\Exception\BlockNotFoundException', 'Sonata\BlockBundle\Exception\Filter\DebugOnlyFilter', 'Sonata\BlockBundle\Exception\Filter\FilterInterface', 'Sonata\BlockBundle\Exception\Filter\IgnoreClassFilter', 'Sonata\BlockBundle\Exception\Filter\KeepAllFilter', 'Sonata\BlockBundle\Exception\Filter\KeepNoneFilter', 'Sonata\BlockBundle\Exception\Renderer\InlineDebugRenderer', 'Sonata\BlockBundle\Exception\Renderer\InlineRenderer', 'Sonata\BlockBundle\Exception\Renderer\MonkeyThrowRenderer', 'Sonata\BlockBundle\Exception\Renderer\RendererInterface', 'Sonata\BlockBundle\Exception\Strategy\StrategyManager', 'Sonata\BlockBundle\Exception\Strategy\StrategyManagerInterface', 'Sonata\BlockBundle\Form\Type\ServiceListType', 'Sonata\BlockBundle\Model\BaseBlock', 'Sonata\BlockBundle\Model\Block', 'Sonata\BlockBundle\Model\BlockInterface', 'Sonata\BlockBundle\Model\BlockManagerInterface', 'Sonata\BlockBundle\Model\EmptyBlock', 'Sonata\BlockBundle\Twig\Extension\BlockExtension', 'Sonata\BlockBundle\Twig\GlobalVariables', 'Sonata\AdminBundle\Admin\AbstractAdmin', 'Sonata\AdminBundle\Admin\AbstractAdminExtension', 'Sonata\AdminBundle\Admin\AdminExtensionInterface', 'Sonata\AdminBundle\Admin\AdminHelper', 'Sonata\AdminBundle\Admin\AdminInterface', 'Sonata\AdminBundle\Admin\BaseFieldDescription', 'Sonata\AdminBundle\Admin\FieldDescriptionCollection', 'Sonata\AdminBundle\Admin\FieldDescriptionInterface', 'Sonata\AdminBundle\Admin\Pool', 'Sonata\AdminBundle\Block\AdminListBlockService', 'Sonata\AdminBundle\Builder\DatagridBuilderInterface', 'Sonata\AdminBundle\Builder\FormContractorInterface', 'Sonata\AdminBundle\Builder\ListBuilderInterface', 'Sonata\AdminBundle\Builder\RouteBuilderInterface', 'Sonata\AdminBundle\Builder\ShowBuilderInterface', 'Sonata\AdminBundle\Datagrid\Datagrid', 'Sonata\AdminBundle\Datagrid\DatagridInterface', 'Sonata\AdminBundle\Datagrid\DatagridMapper', 'Sonata\AdminBundle\Datagrid\ListMapper', 'Sonata\AdminBundle\Datagrid\Pager', 'Sonata\AdminBundle\Datagrid\PagerInterface', 'Sonata\AdminBundle\Datagrid\ProxyQueryInterface', 'Sonata\AdminBundle\Exception\ModelManagerException', 'Sonata\AdminBundle\Exception\NoValueException', 'Sonata\AdminBundle\Filter\Filter', 'Sonata\AdminBundle\Filter\FilterFactory', 'Sonata\AdminBundle\Filter\FilterFactoryInterface', 'Sonata\AdminBundle\Filter\FilterInterface', 'Sonata\AdminBundle\Form\DataTransformer\ArrayToModelTransformer', 'Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer', 'Sonata\AdminBundle\Form\DataTransformer\ModelToIdTransformer', 'Sonata\AdminBundle\Form\EventListener\MergeCollectionListener', 'Sonata\AdminBundle\Form\Extension\Field\Type\FormTypeFieldExtension', 'Sonata\AdminBundle\Form\FormMapper', 'Sonata\AdminBundle\Form\Type\AdminType', 'Sonata\AdminBundle\Form\Type\Filter\ChoiceType', 'Sonata\AdminBundle\Form\Type\Filter\DateRangeType', 'Sonata\AdminBundle\Form\Type\Filter\DateTimeRangeType', 'Sonata\AdminBundle\Form\Type\Filter\DateTimeType', 'Sonata\AdminBundle\Form\Type\Filter\DateType', 'Sonata\AdminBundle\Form\Type\Filter\DefaultType', 'Sonata\AdminBundle\Form\Type\Filter\NumberType', 'Sonata\AdminBundle\Form\Type\ModelReferenceType', 'Sonata\AdminBundle\Form\Type\ModelType', 'Sonata\AdminBundle\Form\Type\ModelListType', 'Sonata\AdminBundle\Guesser\TypeGuesserChain', 'Sonata\AdminBundle\Guesser\TypeGuesserInterface', 'Sonata\AdminBundle\Model\AuditManager', 'Sonata\AdminBundle\Model\AuditManagerInterface', 'Sonata\AdminBundle\Model\AuditReaderInterface', 'Sonata\AdminBundle\Model\ModelManagerInterface', 'Sonata\AdminBundle\Route\AdminPoolLoader', 'Sonata\AdminBundle\Route\DefaultRouteGenerator', 'Sonata\AdminBundle\Route\PathInfoBuilder', 'Sonata\AdminBundle\Route\QueryStringBuilder', 'Sonata\AdminBundle\Route\RouteCollection', 'Sonata\AdminBundle\Route\RouteGeneratorInterface', 'Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap', 'Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder', 'Sonata\AdminBundle\Security\Handler\AclSecurityHandler', 'Sonata\AdminBundle\Security\Handler\AclSecurityHandlerInterface', 'Sonata\AdminBundle\Security\Handler\NoopSecurityHandler', 'Sonata\AdminBundle\Security\Handler\RoleSecurityHandler', 'Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface', 'Sonata\AdminBundle\Show\ShowMapper', 'Sonata\AdminBundle\Translator\BCLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\FormLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface', 'Sonata\AdminBundle\Translator\NativeLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\NoopLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\UnderscoreLabelTranslatorStrategy', 'Sonata\AdminBundle\Twig\Extension\SonataAdminExtension', 'Sonata\AdminBundle\Util\AdminAclManipulator', 'Sonata\AdminBundle\Util\AdminAclManipulatorInterface', 'Sonata\AdminBundle\Util\FormBuilderIterator', 'Sonata\AdminBundle\Util\FormViewIterator', 'Sonata\AdminBundle\Util\ObjectAclManipulator', 'Sonata\AdminBundle\Util\ObjectAclManipulatorInterface'), '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev', 'classes', true, false, '.php') in bootstrap.php.cache line 2609
4 at Kernel->doLoadClassCache('classes', '.php') in bootstrap.php.cache line 2444
5 at Kernel->boot() in bootstrap.php.cache line 2478
6 at Kernel->handle(object(Request)) in app_dev.php line 34
7 at require_once('/www/managedoc/branch/hoffereka/web/app_dev.php') in app_superadmin_dev.php line 3

回答1:


What happens is not necessarily your fault. As you can see here, the problem comes from a deprecation in the block bundle. Maybe the admin bundle (or some other bundle) is using it for some purpose and hasn't yet followed the deprecation recommendation.

Let's first fix the errors in the deprecation messages and make them more precise.

Digging more, you can see that 3.9.0 is supposed to fix this problem.

Can you run composer info to show us what version of the admin bundle you use?



来源:https://stackoverflow.com/questions/40101753/deprecated-warnings-when-using-sonata-admin-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!