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

Uncaught exception 'Error' with message 'Call to a member function getId() on boolean' #7

Open
xantek-imc opened this issue Oct 9, 2019 · 0 comments
Assignees

Comments

@xantek-imc
Copy link

xantek-imc commented Oct 9, 2019

We're seeing errors in NewRelic on our home page and category pages that result in 500 server errors. I think before using $product it should be confirmed to be an object before calling getId(). Note: according to phpdoc $this->product->loadByAttribute
@return bool|\Magento\Catalog\Model\AbstractModel

$stockItem = $this->stockItemModel->load($product->getId(),'product_id')->getData();

Error: Uncaught exception 'Error' with message 'Call to a member function getId() on boolean' in /app/2aunx3kebdnga/vendor/reflektion/reflektion_magento_2/Block/Analytics.php:114
in Reflektion\Catalogexport\Block\Analytics::getAttributes called at ? (?)
in call_user_func_array called at /app/2aunx3kebdnga/vendor/magento/framework/View/TemplateEngine/Php.php (82)
in Magento\Framework\View\TemplateEngine\Php::__call called at /app/2aunx3kebdnga/var/view_preprocessed/pub/static/vendor/reflektion/reflektion_magento_2/view/frontend/templates/analytics/rfk_add_to_cart_analytics.phtml (1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants