If a class has plugins and the deploy mode is set to developer the ObjectManager is supposed to generate an Interceptor of the class as needed. That's what happens when running bin/magento setup:di:compile
.
In my case some Inteceptors are not generated even tho the class has at least one plugin.
I'm trying to add a plugin for a third party class. di.xml
and the after
method are declared correctly and the target method is called. Due to the missing Interceptor the plugin isn't executed.
If I run bin/magento setup:di:compile
the Interceptor is generated and the plugin works as intended.
I tried to debug into \Magento\Framework\Interception\ObjectManager\Config\Developer::getInstanceType
but here I don't get an instance of the class I target with the plugin.
Any ideas what the problem could be?
Update:
I've debugged into the index.php
and checked the state of $app
. _appMode
is set to developer. So I don't think the app mode is overwritten somewhere.
bin/magento setup:di:compile
works just fine but I am in developer mode so it should not be necessary to trigger it manually