magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

Not needed hard dependency between bundle and catalog search modules #104

Open tzyganu opened 5 years ago

tzyganu commented 5 years ago

Preconditions (*)

  1. Magento version 2.2 or 2.3

Steps to reproduce (*)

  1. DIsable module Magento_Bundle by changing 1 to 0 in config.php prior to installing magento since it cannot be disabled via cli because of circular dependencies.
  2. set catalog search full text index to manual bin/magento indexer:set-mode manual catalogsearch_fulltext

Expected result (*)

  1. fulltext search index is set to manual.

    Actual result (*)

    1.console command reports an error

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalog_product_bundle_selection' doesn't exist, query was: CREATE TRIGGER trg_catalog_product_bundle_selection_after_insert AFTER INSERT ON catalog_product_bundle_selection FOR EACH ROW BEGIN INSERT IGNORE INTO catalogsearch_fulltext_cl (entity_id) VALUES (NEW.parent_product_id); END

Additional info.

The problem is caused by this line <table name="catalog_product_bundle_selection" entity_column="parent_product_id" /> from the mview.xml file from the Catalog Search module.
Moving this line to the bundle module looks like it solves the problem.

magento-engcom-team commented 5 years ago

Hi @tzyganu. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop). For more details, please, review the Magento Contributor Assistant documentation.

@tzyganu do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

magento-engcom-team commented 5 years ago

Hi @TomashKhamlai. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

orlangur commented 5 years ago

@tzyganu such bug report is not valid as Bundle module cannot be currently disabled, however, I believe such modularity improvement has high chances to be merged if proposed as a pull request.

orlangur commented 5 years ago

Looks like this is not the only modularity violation, <table name="catalog_product_super_link" entity_column="product_id" /> should belong to ConfigurableProduct (which is removable module, by the way, unlike Bundle).

TomashKhamlai commented 5 years ago

@tzyganu, thank you for reporting this issue. It is expected that if you broke any dependency Magento will not work. This report seems to me like "add us more granular modularity" feature request.

ianitsky commented 5 years ago

It occours if you disable the module Magento_ConfigurableProduct too.

When I run bin/magento setup:upgrade I have the follow error:

Module 'Magento_Indexer': Running data recurring... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalog_product_super_link' doesn't exist, query was: CREATE TRIGGER trg_catalog_product_super_link_after_insert AFTER INSERT ON catalog_product_super_link FOR EACH ROW BEGIN INSERT IGNORE INTO catalogsearch_fulltext_cl (entity_id) VALUES (NEW.product_id); END