adampmoss / foxseo2

Magento Fox SEO Extension for Magento 2 (CreareSEO 2.0)
32 stars 12 forks source link

Bug in observer - DefaultProductMeta.php #3

Open eLoner opened 6 years ago

eLoner commented 6 years ago

"/app/code/Fox/Seo/Observer/DefaultProductMeta.php(38): Fox\Seo\Helper\Data->checkMetaData(NULL, 'category')"

i got an exception on a product page, file Observer/DfaultProductMeta.php this is original code: `/**

here is wrong method getCategory(), it should be getProduct(), "catalog_controller_product_init_after" event is also dispatches the data for it Magento_Catalog\Helper\Product.php:

try { $this->_eventManager->dispatch( 'catalog_controller_product_init_after', ['product' => $product, 'controller_action' => $controller] ); } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->_logger->critical($e); return false; }

venture-travels commented 4 years ago

Hello eLoner, thank you for the comment. Can you please point more specific what to add and what to replace and where? My file 'Observer/DefaultProductMeta.php' is like below now, with the changes you suggest:

I hope you can help me, thank you so much.