-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
The Magento_Webapi cannot be disabled even if the installer UI allows it.
Steps to reproduce:
- Install a new instance of Magento 2 using the web installer
- In the step4, "Customize your store", in the "Advanced Modules Configurations " section, I disable the
Magento_Webapimodule - Proceed with the installation
Expected result
- Magento 2 installs without the
Magento_Webapimodule
Actual result
-
Installer stops at 69% with and error message
Cannot instantiate interface Magento\Framework\Cache\FrontendInterface in
lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php
Additional info:
After digging in the code I found out the problem appears when trying to instaintiate \Magento\Customer\Model\Attribute.
The constructor (inherited from \Magento\Eav\Model\Entity\Attribute) expect and instance of Magento\Framework\Reflection\DataObjectProcessor that expects in its own constructor and instance of Magento\Framework\Reflection\MethodsMap that expects in the constructor and instance of \Magento\Framework\Cache\FrontendInterface called $cache.
There is no preference for \Magento\Framework\Cache\FrontendInterface declared anywhere (maybe because different implementations of this interface are used for different classes)
but the di.xml of the Magento_Webapi contains this:
<type name="Magento\Framework\Reflection\MethodsMap">
<arguments>
<argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Webapi</argument>
</arguments>
</type>
This makes the customer module depend on the webapi module and this dependency is not declared anywhere.