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 For | Type | Should be in |
| app/etc/di.xml | ||
| Magento\Store\Model\StoreManagerInterface | Magento\Store\Model\StoreManager | Magento/Store/etc/di.xml |
| Magento_Backend | ||
| Magento/Backend/etc/di.xml | ||
| Magento\Framework\App\Config\Storage\WriterInterface | Magento\Framework\App\Config\Storage\Writer | app/etc/di.xml |
| Magento\Backend\Model\Auth\Credential\StorageInterface | Magento\User\Model\User | Magento/User/etc/di.xml |
| Magento\Framework\Authorization\PolicyInterface | Magento\Framework\Authorization\Policy\Acl | app/etc/di.xml |
| Magento\Framework\Acl\AclResource\ProviderInterface | Magento\Framework\Acl\AclResource\Provider | app/etc/di.xml |
| Magento/Backend/etc/adminhtml/di.xml | ||
| Magento\Framework\Model\ActionValidator\RemoveAction | Magento\Framework\Model\ActionValidator\RemoveAction\Allowed | app/etc/di.xml |
| Magento_Catalog | ||
| Magento/Catalog/etc/di.xml | ||
| Magento\Framework\Pricing\PriceInfoInterface | Magento\Framework\Pricing\PriceInfo\Base | app/etc/di.xml |
| Magento\Framework\Pricing\PriceCurrencyInterface | Magento\Directory\Model\PriceCurrency | Magento/Directory/etc/di.xml |
| Magento\Framework\Pricing\Adjustment\CalculatorInterface | Magento\Framework\Pricing\Adjustment\Calculator | app/etc/di.xml |
| Magento_Cookie | ||
| Magento/Cookie/etc/di.xml | ||
| Magento\Framework\Stdlib\CookieManagerInterface | Magento\Framework\Stdlib\Cookie\PhpCookieManager | app/etc/di.xml |
| Magento_Cron | ||
| Magento/Cron/etc/di.xml | ||
| Magento\Framework\Shell\CommandRendererInterface | Magento\Framework\Shell\CommandRenderer | app/etc/di.xml |
| Magento_Customer | ||
| Magento/Customer/etc/adminhtml/di.xml | ||
| Magento\Framework\Session\SessionManagerInterface | Magento\Backend\Model\Session | Magento/Backend/etc/adminhtml/di.xml |
| Magento_Developer | ||
| Magento/Developer/etc/di.xml | ||
| Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface | Magento\Framework\View\Asset\PreProcessor\ChainFactory | app/etc/di.xml |
| Magento\Framework\Css\PreProcessor\ErrorHandlerInterface | Magento\Framework\Css\PreProcessor\ErrorHandler | app/etc/di.xml |
| Magento\Framework\View\Asset\PreProcessor\Helper\SortInterface | Magento\Framework\View\Asset\PreProcessor\Helper\Sort | app/etc/di.xml |
| Magento_Email | ||
| Magento/Email/etc/di.xml | ||
| Magento\Framework\Mail\Template\FactoryInterface | Magento\Framework\Mail\Template\Factory | app/etc/di.xml |
| Magento\Framework\Mail\TransportInterface | Magento\Framework\Mail\Transport | app/etc/di.xml |
| Magento\Framework\Mail\MessageInterface | Magento\Framework\Mail\Message | app/etc/di.xml |
| Magento_Indexer | ||
| Magento/Indexer/etc/di.xml | ||
| Magento\Framework\Indexer\Table\StrategyInterface | Magento\Framework\Indexer\Table\Strategy | app/etc/di.xml |
| Magento_NewRelicReporting | ||
| Magento/NewRelicReporting/etc/di.xml | ||
| Magento\Framework\Module\ModuleListInterface | Magento\Framework\Module\ModuleList | app/etc/di.xml |
| Magento_ProductVideo | ||
| Magento/ProductVideo/etc/di.xml | ||
| Magento\Framework\Validator\ValidatorInterface | Magento\Framework\Validator\AllowedProtocols | app/etc/di.xml |
| Magento_Tax | ||
| Magento/Tax/etc/di.xml | ||
| Magento\Tax\Api\Data\OrderTaxDetailsItemInterface | Magento\Sales\Model\Order\Tax\Item | Magento/Sales/etc/di.xml |
| Magento_Theme | ||
| Magento/Theme/etc/di.xml | ||
| Magento\Framework\View\Element\Message\InterpretationStrategyInterface | Magento\Framework\View\Element\Message\InterpretationMediator | app/etc/di.xml |
| Magento\Framework\App\View\Deployment\Version\StorageInterface | Magento\Framework\App\View\Deployment\Version\Storage\File | app/etc/di.xml |
| Magento_Translation | ||
| Magento/Translation/etc/di.xml | ||
| Magento\Framework\Translate\InlineInterface | Magento\Framework\Translate\Inline | app/etc/di.xml |
| Magento\Framework\Translate\Inline\ProviderInterface | Magento\Framework\Translate\Inline\Provider | app/etc/di.xml |
| Magento\Framework\Translate\Inline\StateInterface | Magento\Framework\Translate\Inline\State | app/etc/di.xml |
| Magento\Framework\Phrase\RendererInterface | Magento\Framework\Phrase\Renderer\Composite | app/etc/di.xml |
| Magento/Translation/etc/adminhtml/di.xml | ||
| Magento\Framework\Translate\Inline\ConfigInterface | Magento\Backend\Model\Translate\Inline\Config | Magento/Backend/etc/adminhtml/di.xml |
| Magento_Ui | ||
| Magento/Ui/etc/di.xml | ||
| Magento\Framework\Data\Argument\InterpreterInterface | Magento\Framework\Data\Argument\Interpreter\Composite | app/etc/di.xml |
| Magento\Framework\Config\ConverterInterface | Magento\Framework\View\Element\UiComponent\Config\Converter | app/etc/di.xml |
| Magento\Framework\View\Element\UiComponent\ContextInterface | Magento\Framework\View\Element\UiComponent\Context | app/etc/di.xml |
| Magento\Framework\View\Element\UiComponent\LayoutInterface | Magento\Framework\View\Layout\Generic | app/etc/di.xml |
| Magento\Authorization\Model\UserContextInterface | Magento\Authorization\Model\CompositeUserContext | Magento/Authorization/etc/di.xml |
| Magento\Framework\Api\Search\ReportingInterface | Magento\Framework\View\Element\UiComponent\DataProvider\Reporting | app/etc/di.xml |
| Magento_LayeredNavigation | ||
| Magento/LayeredNavigation/etc/frontend/di.xml | ||
| Magento\Catalog\Model\Layer\AvailabilityFlagInterface | Magento\Catalog\Model\Layer\Category\AvailabilityFlag | Magento/Catalog/etc/frontend/di.xml |
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
Most helpful comment
These are modularity bugs. Thank you for reporting, @strajeru.