Magento2: Preferences declared in wrong modules.

Created on 12 Dec 2016  路  4Comments  路  Source: magento/magento2

This is a followup for #1291. I ran some script on the di.xml files to identify which preferences are declared in the wrong module and came up with the list below.
Sorry if this is not reported as requested, with steps to reproduce, because I didn't take any ui or cli actions to reproduce it.
Please DON'T classify this as an improvement and send it to the forum. This should not be hard to fix (I'm even willing to grab it if you give the OK) and it could help uncouple some modules and prevent issues if some of them are disabled.

Preference ForTypeShould be in
app/etc/di.xml
Magento\Store\Model\StoreManagerInterfaceMagento\Store\Model\StoreManagerMagento/Store/etc/di.xml
Magento_Backend
Magento/Backend/etc/di.xml
Magento\Framework\App\Config\Storage\WriterInterfaceMagento\Framework\App\Config\Storage\Writerapp/etc/di.xml
Magento\Backend\Model\Auth\Credential\StorageInterfaceMagento\User\Model\UserMagento/User/etc/di.xml
Magento\Framework\Authorization\PolicyInterfaceMagento\Framework\Authorization\Policy\Aclapp/etc/di.xml
Magento\Framework\Acl\AclResource\ProviderInterfaceMagento\Framework\Acl\AclResource\Providerapp/etc/di.xml
Magento/Backend/etc/adminhtml/di.xml
Magento\Framework\Model\ActionValidator\RemoveActionMagento\Framework\Model\ActionValidator\RemoveAction\Allowedapp/etc/di.xml
Magento_Catalog
Magento/Catalog/etc/di.xml
Magento\Framework\Pricing\PriceInfoInterfaceMagento\Framework\Pricing\PriceInfo\Baseapp/etc/di.xml
Magento\Framework\Pricing\PriceCurrencyInterfaceMagento\Directory\Model\PriceCurrencyMagento/Directory/etc/di.xml
Magento\Framework\Pricing\Adjustment\CalculatorInterfaceMagento\Framework\Pricing\Adjustment\Calculatorapp/etc/di.xml
Magento_Cookie
Magento/Cookie/etc/di.xml
Magento\Framework\Stdlib\CookieManagerInterfaceMagento\Framework\Stdlib\Cookie\PhpCookieManagerapp/etc/di.xml
Magento_Cron
Magento/Cron/etc/di.xml
Magento\Framework\Shell\CommandRendererInterfaceMagento\Framework\Shell\CommandRendererapp/etc/di.xml
Magento_Customer
Magento/Customer/etc/adminhtml/di.xml
Magento\Framework\Session\SessionManagerInterfaceMagento\Backend\Model\SessionMagento/Backend/etc/adminhtml/di.xml
Magento_Developer
Magento/Developer/etc/di.xml
Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterfaceMagento\Framework\View\Asset\PreProcessor\ChainFactoryapp/etc/di.xml
Magento\Framework\Css\PreProcessor\ErrorHandlerInterfaceMagento\Framework\Css\PreProcessor\ErrorHandlerapp/etc/di.xml
Magento\Framework\View\Asset\PreProcessor\Helper\SortInterfaceMagento\Framework\View\Asset\PreProcessor\Helper\Sortapp/etc/di.xml
Magento_Email
Magento/Email/etc/di.xml
Magento\Framework\Mail\Template\FactoryInterfaceMagento\Framework\Mail\Template\Factoryapp/etc/di.xml
Magento\Framework\Mail\TransportInterfaceMagento\Framework\Mail\Transportapp/etc/di.xml
Magento\Framework\Mail\MessageInterfaceMagento\Framework\Mail\Messageapp/etc/di.xml
Magento_Indexer
Magento/Indexer/etc/di.xml
Magento\Framework\Indexer\Table\StrategyInterfaceMagento\Framework\Indexer\Table\Strategyapp/etc/di.xml
Magento_NewRelicReporting
Magento/NewRelicReporting/etc/di.xml
Magento\Framework\Module\ModuleListInterfaceMagento\Framework\Module\ModuleListapp/etc/di.xml
Magento_ProductVideo
Magento/ProductVideo/etc/di.xml
Magento\Framework\Validator\ValidatorInterfaceMagento\Framework\Validator\AllowedProtocolsapp/etc/di.xml
Magento_Tax
Magento/Tax/etc/di.xml
Magento\Tax\Api\Data\OrderTaxDetailsItemInterfaceMagento\Sales\Model\Order\Tax\ItemMagento/Sales/etc/di.xml
Magento_Theme
Magento/Theme/etc/di.xml
Magento\Framework\View\Element\Message\InterpretationStrategyInterfaceMagento\Framework\View\Element\Message\InterpretationMediatorapp/etc/di.xml
Magento\Framework\App\View\Deployment\Version\StorageInterfaceMagento\Framework\App\View\Deployment\Version\Storage\Fileapp/etc/di.xml
Magento_Translation
Magento/Translation/etc/di.xml
Magento\Framework\Translate\InlineInterfaceMagento\Framework\Translate\Inlineapp/etc/di.xml
Magento\Framework\Translate\Inline\ProviderInterfaceMagento\Framework\Translate\Inline\Providerapp/etc/di.xml
Magento\Framework\Translate\Inline\StateInterfaceMagento\Framework\Translate\Inline\Stateapp/etc/di.xml
Magento\Framework\Phrase\RendererInterfaceMagento\Framework\Phrase\Renderer\Compositeapp/etc/di.xml
Magento/Translation/etc/adminhtml/di.xml
Magento\Framework\Translate\Inline\ConfigInterfaceMagento\Backend\Model\Translate\Inline\ConfigMagento/Backend/etc/adminhtml/di.xml
Magento_Ui
Magento/Ui/etc/di.xml
Magento\Framework\Data\Argument\InterpreterInterfaceMagento\Framework\Data\Argument\Interpreter\Compositeapp/etc/di.xml
Magento\Framework\Config\ConverterInterfaceMagento\Framework\View\Element\UiComponent\Config\Converterapp/etc/di.xml
Magento\Framework\View\Element\UiComponent\ContextInterfaceMagento\Framework\View\Element\UiComponent\Contextapp/etc/di.xml
Magento\Framework\View\Element\UiComponent\LayoutInterfaceMagento\Framework\View\Layout\Genericapp/etc/di.xml
Magento\Authorization\Model\UserContextInterfaceMagento\Authorization\Model\CompositeUserContextMagento/Authorization/etc/di.xml
Magento\Framework\Api\Search\ReportingInterfaceMagento\Framework\View\Element\UiComponent\DataProvider\Reportingapp/etc/di.xml
Magento_LayeredNavigation
Magento/LayeredNavigation/etc/frontend/di.xml
Magento\Catalog\Model\Layer\AvailabilityFlagInterfaceMagento\Catalog\Model\Layer\Category\AvailabilityFlagMagento/Catalog/etc/frontend/di.xml
Clear Description Confirmed Format is not valid Ready for Work bug report up for grabs

Most helpful comment

These are modularity bugs. Thank you for reporting, @strajeru.

All 4 comments

These are modularity bugs. Thank you for reporting, @strajeru.

Hello @tzyganu, the task for static tests is created - MAGETWO-63568. It will define all similar issues for di.xml, and then we will be able to fix them.

@KrystynaKabannyk I picked this up myself. Just one more question. Since I'm cleaning up the di.xml files, do you think it's worth to make them more consistent? I mean, I want to move all preference tags at the top, then types with plugins, then types with arguments and in the end the virtual types.

Hi @tzyganu Thank you for investigation. We are looking for PRs from you! Closing the issue

Was this page helpful?
0 / 5 - 0 ratings