I want to unregister the service cmf_block.reference_admin from Symfony. After some research I found out, that it should be done via CompilerPass. Here is how I removed it:
namespace PortalBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class UnregisterThirdPartyServicesPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if($container->getDefinition('cmf_block.reference_admin'))
$container->removeDefinition('cmf_block.reference_admin');
}
}
After having this done, I get an error:
Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException' with message 'You have requested a non-existent service "cmf_block.reference_admin".' in xxx\cmf-sandbox-master\app\bootstrap.php.cache:2198 Stack trace: #0 xxx\cmf-sandbox-master\app\cache\dev\classes.php(11818): Symfony\Component\DependencyInjection\Container->get('cmf_block.refer...') #1 xxx\cmf-sandbox-master\vendor\sonata-project\admin-bundle\Route\RoutesCacheWarmUp.php(47): Sonata\AdminBundle\Admin\Pool->getInstance('cmf_block.refer...') #2 xxx\cmf-sandbox-master\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate.php(48): Sonata\AdminBundle\Route\RoutesCacheWarmUp->warmUp('xxx') #3 xxx\cmf-sandbox-master\app\bootstrap.php.cache(2711): Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp('C:\ in xxx\cmf-sandbox-master\app\bootstrap.php.cache on line 2198
Maybe somebody of you can help me or knows, how it is possible to remove the Reference Block functionality of the CMF Block Bundle from my Symfony.
Thanks a lot in advance!