我有两个模块使用Magento\Framework\App\State::afterSetAreaCode
的插件
当两个模块都启用时,magento抛出:
1 exception(s):
Exception #0 (Exception): Notice: Undefined index:
Magento\Framework\App\State in /vendor/magento/framework/Interception/PluginList/PluginList.php on line 250
我已经遵循了代码,并得出结论,故障似乎是一个
Magento\NewRelicReporting\Plugin\StatePlugin::afterSetAreaCode
。此模块和方法正在调用检索某些配置值。不知何故,检索这些值会加载其他配置文件并重置
Magento\Framework\Interception\PluginList\PluginList::_pluginInstances
列表,然后当Magento\Framework\Interception\Interceptor
中列表中的下一个插件尝试调用getPlugin
方法时返回错误。这似乎只有当缓存清除时才会发生,一旦它被填充,站点似乎就可以工作,但显然它不会正常工作。
有人遇到过这样的问题吗?
最佳答案
我从生产模式切换到开发模式,然后切换回生产模式,这样有助于解决这个问题。
php bin/magento de:mod:set developer
php bin/magento de:mod:set production
关于php - undefined index :Magento 2.2.6中带有NewRelic模块的Magento\Framework\App\State,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53100995/