Skip to content

Webapi module cannot be disabled #1759

@tzyganu

Description

@tzyganu

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_Webapi module
  • Proceed with the installation

Expected result

  • Magento 2 installs without the Magento_Webapi module

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions