Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hard dependency of InventoryCatalog on Inventory module #1151

Closed
maghamed opened this issue May 15, 2018 · 0 comments
Closed

Fix hard dependency of InventoryCatalog on Inventory module #1151

maghamed opened this issue May 15, 2018 · 0 comments

Comments

@maghamed
Copy link
Contributor

Currently, we have a hard dependency of module InventoryCatalog on Inventory because of

class \Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave

We use this class implementation to prevent repetitive synchronization of Legacy-MSI-Legacy update. To make this happen we add new implementation (along with one we have in Inventory Module) and disable Plugin on it

    <type name="Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave">
        <plugin name="set_data_to_legacy_catalog_inventory_at_source_items_save" disabled="true"/>
    </type>

what we need to do is:

  • move class \Magento\InventoryCatalog\Model\SourceItem\SourceItemsSave under the same namespace where \Magento\Inventory\Model\SourceItem\Command\SourceItemsSave stored
  • rename SourceItemsSave -> SourceItemsSaveWithoutLegacySynchronization
  • to prevent copy-pasting and making both class to have the same logic - introduce proxy
  • inject this proxy in both of these classes SourceItemsSaveWithoutLegacySynchronization and SourceItemsSave and proxy method execute on the newly created class

after that change dependency of InventoryCatalog to Inventory as "soft" one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants