Closed kyeno closed 3 years ago
@VincentLanglet? :)
I don't know why I'm tagged here 😅
Sorry, but we try to keep github issues for feature requests and bugs only.
In your case, it does not seems to be a Sonata issue, but a Symfony one, I'm sure you'll get a lot of help on Symfony slack. ;) I never used CompilerPass but I would say that you need to set the service after the mofication.
$container->setDefinition($serviceName);
I'm using SonataNewsBundle, yet without Comments functionality. I managed to hide any occurences of it in Post's FormMapper and ListMapper, but I also wanted to hide it in Dashboard completely.
I wrote a custom CompilerPass that should inject
show_in_dashboard: false
tag to that service (and indebug:container sonata.news.admin.comment
it does!), but it doesn't seem to affect Sonata's menu behavior at all.Here's my
CompilerPass
:If this is not the right approach, how else do I force Sonata to hide unneeded services in Admin Dashboard?