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

Fatal error with Google Tag Manager on Magento Cloud Commerce 2.2.5 #20164

Closed
jfgalano opened this issue Jan 10, 2019 · 9 comments
Closed

Fatal error with Google Tag Manager on Magento Cloud Commerce 2.2.5 #20164

jfgalano opened this issue Jan 10, 2019 · 9 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

@jfgalano
Copy link

Preconditions (*)

  1. Magento Cloud Commerce 2.2.5
  2. Google Tag Manager enabled

Steps to reproduce (*)

  1. Enabling Google Tag Manager

Expected result (*)

  1. Product page displayed

Actual result (*)

  1. Failure when display a product page
  2. Fatal error: Uncaught Error: Call to a member function getLoadedProductCollection() on boolean in /app/vendor/magento/module-google-tag-manager/Block/ListJson.php:206 Stack trace: #0 /app/vendor/magento/module-google-tag-manager/Block/ListJson.php(190): Magento\GoogleTagManager\Block\ListJson->_getProductCollection() Can you commit to repository a folder dev/tests/static ? #1 /app/vendor/magento/module-google-tag-manager/Block/ListJson.php(240): Magento\GoogleTagManager\Block\ListJson->_getProducts() BUG FIX - Uncaught exception when accessing admin with none existent use... #2 /app/vendor/magento/module-google-tag-manager/view/frontend/templates/impression.phtml(11): Magento\GoogleTagManager\Block\ListJson->getLoadedProductCollection() __DIR__ Typo fixed #3 /app/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/app/vendor/mag...') Enable Magento_Profiler by SetEnv #4 /app/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\GoogleTagManager\Block\ListJson), '/app/vendor/mag...', Array) Enable automated CRUD setup for Adminhtml Grids #5 /app/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/app/vendor/mag.. in /app/vendor/magento/module-google-tag-manager/Block/ListJson.php on line 206Fatal error: Uncaught Error: Call to a member function getLoadedProductCollection() on boolean in /app/vendor/magento/module-google-tag-manager/Block/ListJson.php:206 Stack trace: #0 /app/vendor/magento/module-google-tag-manager/Block/ListJson.php(190): Magento\GoogleTagManager\Block\ListJson->_getProductCollection() Can you commit to repository a folder dev/tests/static ? #1 /app/vendor/magento/module-google-tag-manager/Block/ListJson.php(240): Magento\GoogleTagManager\Block\ListJson->_getProducts() BUG FIX - Uncaught exception when accessing admin with none existent use... #2 /app/vendor/magento/module-google-tag-manager/view/frontend/templates/impression.phtml(11): Magento\GoogleTagManager\Block\ListJson->getLoadedProductCollection() __DIR__ Typo fixed #3 /app/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/app/vendor/mag...') Enable Magento_Profiler by SetEnv #4 /app/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\GoogleTagManager\Block\ListJson), '/app/vendor/mag...', Array) Enable automated CRUD setup for Adminhtml Grids #5 /app/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/app/vendor/mag.. in /app/vendor/magento/module-google-tag-manager/Block/ListJson.php on line Page Creation Tab(s) in Admin New Theme Not Working #206
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 10, 2019
@magento-engcom-team
Copy link
Contributor

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.

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

  • yes
  • no

@irajneeshgupta irajneeshgupta self-assigned this Jan 10, 2019
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Jan 10, 2019

Hi @irajneeshgupta. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@irajneeshgupta irajneeshgupta added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Jan 10, 2019
@ghost ghost self-assigned this Jan 10, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost
Copy link

ghost commented Jan 10, 2019

hi @jfgalano
GitHub is intended for Magento Open Source users to report on issues related to Open Source only.
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.

@ghost ghost closed this as completed Jan 10, 2019
@irajneeshgupta irajneeshgupta removed their assignment Jan 10, 2019
@sjb9774
Copy link
Contributor

sjb9774 commented Feb 14, 2019

@irajneeshgupta I recently had this problem, are you still able to look into this?

I am running Magento Enterprise 2.2.7.

The issue is that there are hardcoded block names in magento/module-google-tag-manager/view/frontend/layout/catalog_product_view.xml such as product.info.upsell. These block names are used in \Magento\GoogleTagManager\Block\ListJson::getListBlock to retrieve information, but in my case we had removed the product.info.upsell block in a theme layout file so the code broke at \Magento\GoogleTagManager\Block\ListJson::206 due to the getListBlock method returning false (because of the missing block) and there being no code that verifies whether the block actually exists or not.

@sjb9774 sjb9774 reopened this Feb 14, 2019
@ghost
Copy link

ghost commented Feb 15, 2019

HI @sjb9774 the google-tag-manager available only in EE version, We can accept only CE issues.

@ghost ghost closed this as completed Feb 15, 2019
@snowcore
Copy link

snowcore commented Sep 26, 2019

This happens if you removed catalog.product.related or product.info.upsell block.
Reference: vendor/magento/module-google-tag-manager/view/frontend/layout/catalog_product_view.xml
Tag manager expects these blocks to be present on a product page.
There has been fixed in EE repo.

@Ohopwood
Copy link

Ohopwood commented Dec 6, 2019

Was there a permanent fix applied to this?
The link in @snowcore comment doesn't work anymore.

@kanhaiya5590
Copy link
Contributor

kanhaiya5590 commented Dec 24, 2019

@jfgalano @Ohopwood
This happens if you removed any one of these catalog.product.related or product.info.upsell or checkout.cart.crosssell or search_result_list or checkout.cart.crosssell or category.products.list block(s).
To make it work i created a patch.

Hope this will help.

This issue was closed.
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

7 participants