This is an old revision of the document!


Fatal error output in footer when LiteMage enabled

The user is uring Magento 1.9.3.6 store with Meigee feather theme. As soon as LiteMage enabled, some “Fatal Error” message appears in header and footer.

At the top of the homepage, it shows:

Fatal error: Uncaught Error: Call to undefined method Litespeed_Litemage_Model_EsiLayout::getMConfigResultByAlias() in 
/home/yourdomain/public_html/app/design/frontend/feather/locker/template/checkout/cart/topcart.phtml:12 Stack trace: #0 
/home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(241): include() #1 
/home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template-
>fetchView('frontend/feathe...') #2 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(286): 
Mage_Core_Block_Template->renderView() #3 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): 
Mage_Core_Block_Template->_toHtml() #4 
/home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(217): Mage_Core_Block_Abstract-
>toHtml() #5 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(436): 
Litespeed_Litemage_EsiController->_renderEsiBlock(Object(Litespeed_Litemage_Model_EsiDa in 
/home/yourdomain/public_html/app/design/frontend/feather/locker/template/checkout/cart/topcart.phtml on line 12

At the bottom of the homepage, it shows:

THERE HAS BEEN AN ERROR PROCESSING YOUR REQUEST
Exception printing is disabled by default for security reasons.
Error log record number: 600210582390

When check error report:

a:5:{i:0;s:56:"Invalid method Mage_Page_Block_Html_Footer::(Array
(
)
)";i:1;s:2050:"#0 /home/yourdomain/public_html/app/code/core/Mage/Core/Model/Layout.php(348): Varien_Object->__call('', Array)
#1 /home/yourdomain/public_html/app/code/core/Mage/Core/Model/Layout.php(214): Mage_Core_Model_Layout-
>_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#2 /home/yourdomain/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout-
>generateBlocks(Object(Mage_Core_Model_Layout_Element))
#3 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/Model/EsiLayout.php(68): Mage_Core_Model_Layout-
>generateBlocks()
#4 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(435): 
Litespeed_Litemage_Model_EsiLayout->loadEsiLayout(Object(Litespeed_Litemage_Model_EsiData))
#5 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(399): 
Litespeed_Litemage_EsiController->_processLayout(Array)
#6 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(150): 
Litespeed_Litemage_EsiController->_processScheduled()
#7 /home/yourdomain/public_html/app/code/community/Litespeed/Litemage/controllers/EsiController.php(136): 
Litespeed_Litemage_EsiController->_getSingle()
#8 /home/yourdomain/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Litespeed_Litemage_EsiController-
>getBlockAction()
#9 /home/yourdomain/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): 
Mage_Core_Controller_Varien_Action->dispatch('getBlock')
#10 /home/yourdomain/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): 
Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/yourdomain/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/yourdomain/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#13 /home/yourdomain/public_html/index.php(89): Mage::run('', 'store')
#14 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

It is a signal that some of the themes/plugins/modules may be conflicting with LiteSpeed module. You can choose LiteMage level 3 support to analyze your theme's code to be able to locate the problematic section and fix it(LiteMage Premium support is fully refundable if we fail to enable LiteMage cache for your site) or you can engage third-party experienced Magento developer for troubleshooting. If you are an experienced Magento yourself, this wiki will show you the basic troubleshooting steps on how to locate the code section problem and fix it.

First of all, you will need to enable LiteMage debug log to check details. It is not Magento's system.log (which is controlled by System→ Advanced→ Developer→Log Settings→ Enabled, should leave as it is), instead, a separate litemage.log file(which controled by LiteMage settings):

Enable debug log should change to “Yes” Debug Level, change to “9” Disable layout override for non-cacheable routes: Change to “yes”

then check var/log/litemage.log for details.

From the error message, seems footer ESI problem, we will try to disable LiteMage footer ESI to see how it is going.

cd app/code/community/Litespeed/Litemage/etc/ cp -p config.xml config.xml.bak1 vi config.xml

then go to <esiblock> section and comment out footer section:

              <!-- public blocks -->
                  <!-- Some themes will use a variable in footer that is declared in the header,
              this causes the footer block to fail to generate. You can modify the
              template to generate the missing variable or simply choose to not punch
              a hole in footer (comment out the footer block).
              Making the footer a public block will speed up page generation and save some disk space  -->
              <!-- footer>
                  <access>public</access>
                  <blocks>footer</blocks>
              </footer -->

After configuration change, you will need to refresh the config: go to Magento Admin→ System → Cache Management , then tick configuration and layouts to refresh.

this attempt doesn't fix the issue.

Errors are caused by class rewrite confliction with LiteMage. Both LiteMage class Litespeed_Litemage_Model_EsiLayout and Meigee ThemeManager class Meigee_Thememanager_Rewrite_Core_Layout will override Mage_Core_Model_Layout.

In app/code/local/Meigee/Thememanager/etc/config.xml

          <core>
              <rewrite>
                  <layout>Meigee_Thememanager_Rewrite_Core_Layout</layout>  <!-- Mage_Core_Model_Layout -->
              </rewrite>
          </core>

Will show error from topcart.phtml called undefined function getMConfigResultByAlias

vi app/design/frontend/feather/locker/template/checkout/cart/topcart.phtml

$meigeeOptions = $this->getLayout();
$catalogModeWrapper = $meigeeOptions->getMConfigResultByAlias('catalog_mode');
$catalogMode = $catalogModeWrapper['value']['sv2']['value'];

$meigeeOptions = $this→getLayout(); $catalogModeWrapper = $meigeeOptions→getMConfigResultByAlias('catalog_mode'); $catalogMode = $catalogModeWrapper['value']['sv2']['value'];

Find out what is $catalogMode, and replace with the actual value. This will make the configuration change invalid. So if you change this value in config, you need to manually update here. Now the new file will look like this:

/* commented out due to conflict with LiteMage * * $meigeeOptions = $this→getLayout(); * $catalogModeWrapper = $meigeeOptions→getMConfigResultByAlias('catalog_mode'); * $catalogMode = $catalogModeWrapper['value']['sv2']['value']; */

$catalogMode = 0; // use the value directly

Seem fix the problem and run more testing.

After add to cart, and refresh, page goes blank. View html source, can see the Fatal Error output Calling from app/design/frontend/feather/default/template/checkout/cart/sidebar/default.phtml

<b>Fatal error</b>: Uncaught Error: Call to undefined method Litespeed_Litemage_Model_EsiLayout::checkVersion() in /home/yourdomain/public_html/app/design/frontend/feather/default/template/checkout/cart/sidebar/default.phtml:17
Stack trace:
#0 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(241): include()
#1 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template-

&gt;fetchView('frontend/feathe…')

#2 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template-&gt;renderView()
#3 /home/yourdomain/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template-&gt;_toHtml()
#4 /home/yourdomain/public_html/app/code/core/Mage/Checkout/Block/Cart/Abstract.php(174): Mage_Core_Block_Abstract-&gt;toHtml()
#5 /home/yourdomain/public_html/app/design/frontend/feather/locker/template/checkout/cart/topcart.phtml(38): 

Mage_Checkout_Block_Cart_Abstract-&gt;getItemHtml(Object(Mage_Sales_Model_Quote_Item))

#6 /home/yourlocke in 

<b>/home/yourdomain/public_html/app/design/frontend/feather/default/template/checkout/cart/sidebar/default.phtml</b> on line <b>17</b><br />

<!--Litemage esi ended cart_sidebar-->   

Go to the file and edit vi

There are multiple places showing Mage::app()→getLayout()→checkVersion('1.7.x.x') ? $this→htmlEscape : $this→escapeHtml The code app/code/local/Meigee/Thememanager/Rewrite/Core/Layout.php Is just checking if Magento version is 1.7.x, while current store is 1.9.3, so always false

Replace to $this→escapeHtml

Problem fixed. Basically the steps are to locate problem part in Meigee feather theme and fix them.

  • Admin
  • Last modified: 2018/01/12 20:51
  • by Jackson Zhang