yireo-magento1 / Yireo_GoogleTagManager

Implement Google Tag Manager in Magento 1 (deprecated)
Open Software License 3.0
56 stars 46 forks source link

Error open product page #87

Closed globallfull closed 6 years ago

globallfull commented 6 years ago

Update my version 1.4.3 to 1.4.6

Fatal error: Call to a member function getSource() on boolean in /usr/local/var/my-magento/app/code/core/Mage/Catalog/Model/Product.php on line 1385

jissereitsma commented 6 years ago

Which version of Magento are you using? Also, a Fatal Error usually comes with a stack trace leading back to the code where this error originates from. Could you include this stack trace?

gety9 commented 6 years ago

+1,

Trying to upgrade from 1.4.3 to 1.4.6 and getting exactly same error.

SCREENSHOT

Fatal error: Call to a member function getSource() on boolean in /var/www/html/app/code/core/Mage/Catalog/Model/Product.php on line 1385

1 | 0.0013 | 248864 | {main}( ) | .../index.php:0
2 | 0.0301 | 516400 | Mage::run( ) | .../index.php:91
3 | 0.0907 | 1440072 | Mage_Core_Model_App->run( ) | .../Mage.php:684
4 | 1.7953 | 8967064 | Mage_Core_Controller_Varien_Front->dispatch( ) | .../App.php:365
5 | 1.8499 | 9237256 | Mage_Core_Controller_Varien_Router_Standard->match( ) | .../Front.php:172
6 | 1.9153 | 9732080 | Mage_Core_Controller_Varien_Action->dispatch( ) | .../Standard.php:254
7 | 4.7369 | 11459264 | Mage_Catalog_ProductController->viewAction( ) | .../Action.php:418
8 | 4.7476 | 11504456 | Mage_Catalog_Helper_Product_View->prepareAndRender( ) | .../ProductController.php:132
9 | 7.1842 | 32936320 | Mage_Core_Controller_Varien_Action->renderLayout( ) | .../View.php:147
10 | 7.1844 | 32937688 | Mage_Core_Model_Layout->getOutput( ) | .../Action.php:390
11 | 7.1844 | 32938160 | Mage_Core_Block_Abstract->toHtml( ) | .../Layout.php:555
12 | 10.1397 | 41207880 | Mage::dispatchEvent( ) | .../Abstract.php:943
13 | 10.1397 | 41207880 | Mage_Core_Model_App->dispatchEvent( ) | .../Mage.php:448
14 | 10.1484 | 41284944 | Mage_Core_Model_App->_callObserverMethod( ) | .../App.php:1336
15 | 10.1484 | 41284944 | Yireo_GoogleTagManager_Observer_LazyLoadDataLayer->execute( ) | .../App.php:1357
16 | 10.1485 | 41284944 | Yireo_GoogleTagManager_Observer_LazyLoadDataLayer->appendDataLayer( ) | .../LazyLoadDataLayer.php:59
17 | 10.1485 | 41285368 | Mage_Core_Block_Abstract->toHtml( ) | .../LazyLoadDataLayer.php:86
18 | 10.1486 | 41286168 | Yireo_GoogleTagManager_Block_Default->_toHtml( ) | .../Abstract.php:919
19 | 10.1486 | 41286168 | Mage_Core_Block_Template->_toHtml( ) | .../Default.php:214
20 | 10.1486 | 41286280 | Mage_Core_Block_Template->renderView( ) | .../Template.php:286
21 | 10.1507 | 41286976 | Mage_Core_Block_Template->fetchView( ) | .../Template.php:272
22 | 10.1579 | 41310320 | include( '/var/www/html/app/design/frontend/base/default/template/googletagmanager/data.phtml' ) | .../Template.php:241
23 | 10.1580 | 41310528 | Mage_Core_Block_Abstract->getChildHtml( ) | .../data.phtml:15
24 | 10.4914 | 45284048 | Mage_Core_Block_Abstract->_getChildHtml( ) | .../Abstract.php:577
25 | 10.4914 | 45284472 | Mage_Core_Block_Abstract->toHtml( ) | .../Abstract.php:637
26 | 10.4914 | 45285272 | Yireo_GoogleTagManager_Block_Default->_toHtml( ) | .../Abstract.php:919
27 | 10.4914 | 45285272 | Mage_Core_Block_Template->_toHtml( ) | .../Default.php:214
28 | 10.4914 | 45285384 | Mage_Core_Block_Template->renderView( ) | .../Template.php:286
29 | 10.4935 | 45286088 | Mage_Core_Block_Template->fetchView( ) | .../Template.php:272
30 | 10.5031 | 45337880 | include( '/var/www/html/app/design/frontend/base/default/template/googletagmanager/data/product.phtml' ) | .../Template.php:241
31 | 10.5134 | 45350936 | Mage_Catalog_Model_Product->getAttributeText( ) | .../product.phtml:72

include( '/var/www/html/app/design/frontend/base/default/template/googletagmanager/data.phtml' ) and include( '/var/www/html/app/design/frontend/base/default/template/googletagmanager/data/product.phtml' ) marked in green and pointing to this part:

        try {
            $includeFilePath = realpath($this->_viewDir . DS . $fileName);
            if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) {
                include $includeFilePath;
            } else {
                Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true);
            }

Line 241 is include $includeFilePath;

Magento ver 1.9.2 php 5.6 (not sure if it can be the reason)

@globallfull were you able to fix it?

jissereitsma commented 6 years ago

This should be fixed now in https://github.com/yireo/Yireo_GoogleTagManager/releases/tag/1.4.7