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

Issue with product listings when shared catalog is enabled #10994

Closed
jajaramos opened this issue Sep 22, 2017 · 2 comments
Closed

Issue with product listings when shared catalog is enabled #10994

jajaramos opened this issue Sep 22, 2017 · 2 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@jajaramos
Copy link

Preconditions

  1. Magento v2.2.0-rc30
  2. PHP Version 7.0.8
  3. Enable Magento Shared Catalog from the admin

Steps to reproduce

  1. After enabling Magento shared catalog form the admin, go to Magento frontend pages with product listing such us homepage and category pages.

Expected result

  1. Page with product listing to display properly.

Actual result

  1. Exception thrown in homepage and category pages, see below stack trace:
    a:4:{i:0;s:54:"A joint field with this alias (0) is already declared.";i:1;s:4031:"#0 /home/m2b2b/public_html/releases/20170510193500/app/code/Magento/SharedCatalog/Plugin/Catalog/Model/ResourceModel/Product/CollectionPlugin.php(73): Magento\Eav\Model\Entity\Collection\AbstractCollection->joinTable(Array, 'sku = sku', Array, '{{table}}.custo...')
    Can you commit to repository a folder dev/tests/static ? #1 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(121): Magento\SharedCatalog\Plugin\Catalog\Model\ResourceModel\Product\CollectionPlugin->beforeLoad(Object(Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor), false, false)
    BUG FIX - Uncaught exception when accessing admin with none existent use... #2 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->Magento\Framework\Interception{closure}()
    __DIR__ Typo fixed #3 /home/m2b2b/public_html/releases/20170510193500/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(26): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->___callPlugins('load', Array, Array)
    Enable Magento_Profiler by SetEnv #4 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Data/Collection.php(819): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->load()
    Enable automated CRUD setup for Adminhtml Grids #5 /home/m2b2b/public_html/releases/20170510193500/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php(352): Magento\Framework\Data\Collection->getIterator()
    Why use private for message ? #6 /home/m2b2b/public_html/releases/20170510193500/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php(71): Magento\CatalogWidget\Block\Product\ProductsList->getIdentities()
    Ability to provide configuration for different environments in app/etc/local.xml #7 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(146): Magento\PageCache\Model\Layout\LayoutPlugin->afterGetOutput(Object(Magento\Framework\View\Layout\Interceptor), ' <script>\n ...')
    Clear separation for Controller and controllers required with Full Controller path #8 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception{closure}()
    Added: dispatchEvent to deleteAction(). Only existed in massDeleteAction(). #9 /home/m2b2b/public_html/releases/20170510193500/generated/code/Magento/Framework/View/Layout/Interceptor.php(52): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
    Merged JS/CSS improvements #10 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
    Design suggestion for cross browser compitablity #11 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
    core/template block should use a helper or a model #12 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
    Performance Testing #13 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
    Adding dispatch of an event before and after applyAllUpdates() #14 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
    Decrease dependencies from Mage class #15 /home/m2b2b/public_html/releases/20170510193500/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
    Block must know nothing about his parent #16 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
    Move validation of Mage_Customer_Model_Address to another class #17 /home/m2b2b/public_html/releases/20170510193500/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
    MCACE-136 - Catalog API call assignProduct does not pass $identifierType... #18 /home/m2b2b/public_html/releases/20170510193500/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    Allow module dependencies to not be "hard" dependencies. #19 {main}";s:3:"url";s:21:"/index.php/women.html";s:11:"script_name";s:10:"/index.php";}
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Sep 22, 2017
@magento-engcom-team
Copy link
Contributor

@jajaramos thank you for your report. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

@agata-maksymiuk
Copy link

For those who are googling this error like me.

This error happens when loading product collection fails for some other reason.
And unfortunately, for an unknown reason, you will get no real error message but this crap.

Here is some information that could help you debug:

  1. Open vendor/magento/module-shared-catalog/Plugin/Catalog/Model/ResourceModel/Product/CollectionPlugin.php
  2. Go to public function beforeLoad( method.
  3. Comment join table to collection code:
    $collection->joinTable( ['shared_product' => $collection->getTable( \Magento\SharedCatalog\Setup\InstallSchema::SHARED_CATALOG_PRODUCT_ITEM_TABLE_NAME )], 'sku = sku', ['customer_group_id'], '{{table}}.customer_group_id = \'' . $customerGroupId . '\'' );

Then in var/report you will get true error.
In my case it was some problem with product attribute and elasticsearch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

4 participants