Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:cache:litemage:troubleshooting:fatal_error_uncaught_error_call_to_undefined_method [2018/01/12 20:51]
Jackson Zhang created
litespeed_wiki:cache:litemage:troubleshooting:fatal_error_uncaught_error_call_to_undefined_method [2018/01/12 22:16] (current)
Jackson Zhang [Next Step: Investigate the Code In Depth]
Line 1: Line 1:
-====== Fatal error output ​in footer ​when LiteMage ​enabled ​======+====== Fatal Error Output ​in Footer ​when LiteMage ​is Enabled ​======
 ===== Fatal error: Uncaught Error: Call to undefined method ===== ===== Fatal error: Uncaught Error: Call to undefined method =====
-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. ​+The user is running a Magento 1.9.3.6 store with Meigee's Feather ​theme. As soon as LiteMage ​is enabled, ​"Fatal Error" message appears in the header and footer. ​
  
 At the top of the homepage, it shows: At the top of the homepage, it shows:
Line 22: Line 22:
   Error log record number: 600210582390   Error log record number: 600210582390
  
-When check error report:+The error report ​shows:
  
   a:​5:​{i:​0;​s:​56:"​Invalid method Mage_Page_Block_Html_Footer::​(Array   a:​5:​{i:​0;​s:​56:"​Invalid method Mage_Page_Block_Html_Footer::​(Array
Line 53: Line 53:
   #14 {main}";​s:​3:"​url";​s:​1:"/";​s:​11:"​script_name";​s:​10:"/​index.php";​s:​4:"​skin";​s:​7:"​default";​}   #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 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.+All of this is a signal that some of the themes/​plugins/​modules may be conflicting with the LiteSpeed module. You can choose LiteMage ​Level Support ​to analyze your theme'​s codelocate 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 ​developer ​yourself, this wiki will show you the basic troubleshooting steps involved in locating ​the problematic section of code and fixing ​it.
  
 ===== Enable debug log ===== ===== Enable debug log =====
-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-> Enabledshould leave as it is), instead, a separate litemage.log file(which ​controled ​by LiteMage settings):+First of all, you will need to enable LiteMage'​s ​debug log to check the details. ​This is not Magento'​s system.log (which is controlled by **System > Advanced > Developer > Log Settings > Enabled**). That one you should leave as is. Insteadwe are referring to a separate ​''​litemage.log'' ​file (which ​is controlled ​by LiteMage settings):
  
  {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-debug-logging.png?​600 |}}  {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-debug-logging.png?​600 |}}
  
-Enable ​debug log should ​change to "Yes" +**Enable ​Debug Log** should ​be ''​Yes''​ 
-Debug Level, change to "9" +**Debug Level** should be ''​9''​ 
-Disable ​layout override ​for non-cacheable routes: Change to "yes"+**Disable ​Layout Override ​for Non-Cacheable Routes** should be ''​yes''​
  
-then check var/​log/​litemage.log for details.+Once the above is properly configures, ​then you can check ''​var/​log/​litemage.log'' ​for the error details.
  
-===== First Effort: Disable LiteMage ​footer ​ESI =====+===== First Effort: Disable LiteMage ​Footer ​ESI =====
  
-From the error message, seems footer ESI problem, we will try to disable LiteMage footer ESI to see how it is going.+From the error message, ​it seems the footer ESI may be the problem. We will try to disable LiteMage footer ESI and see if that helps.
  
-cd app/​code/​community/​Litespeed/​Litemage/​etc/​ +  ​cd app/​code/​community/​Litespeed/​Litemage/​etc/​ 
-cp -p config.xml config.xml.bak1 +  cp -p config.xml config.xml.bak1 
-vi config.xml+  vi config.xml
  
-then go to ''<​esiblock>''​ section and comment out footer section:+Scroll ​to the ''<​esiblock>''​ section and comment out the ''​footer'' ​section:
  
                 <!-- public blocks -->                 <!-- public blocks -->
Line 81: Line 81:
                 template to generate the missing variable or simply choose to not punch                 template to generate the missing variable or simply choose to not punch
                 a hole in footer (comment out the footer block).                 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  -->                 Making the footer a public block will speed up page generation and save some disk space  -->
                 <!-- footer>                 <!-- footer>
Line 87: Line 86:
                     <​blocks>​footer</​blocks>​                     <​blocks>​footer</​blocks>​
                 </footer -->                 </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.+ 
 +Save the file and refresh the config ​in Magento Adminnavigate ​to **Magento Admin > System > Cache Management**, tick **Configuration** ​and **Layouts** ​to refresh. 
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-cachemanagement-configuration-refresh.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-cachemanagement-configuration-refresh.png?​600 |}}
  
-this attempt ​doesn'​t fix the issue.+Unfortunately,​ disabling the LiteMage footer ESI doesn'​t fix the issue.
  
-===== Investigate the codes in-depth ​=====+===== Next Step: Investigate the Code In Depth =====
  
-Errors are caused by class rewrite ​confliction ​with LiteMage.  +Errors are caused by class rewrite ​conflict ​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+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>​             <​core>​
                 <​rewrite>​                 <​rewrite>​
Line 103: Line 105:
                 </​rewrite>​                 </​rewrite>​
             </​core>​             </​core>​
-Will show error from topcart.phtml called undefined function getMConfigResultByAlias 
  
-vi app/​design/​frontend/​feather/​locker/​template/​checkout/​cart/​topcart.phtml+We see there is an error from ''​topcart.phtml''​ as it called an undefined function ''​getMConfigResultByAlias''​. 
 + 
 +  ​vi app/​design/​frontend/​feather/​locker/​template/​checkout/​cart/​topcart.phtml 
   $meigeeOptions = $this->​getLayout();​   $meigeeOptions = $this->​getLayout();​
   $catalogModeWrapper = $meigeeOptions->​getMConfigResultByAlias('​catalog_mode'​);​   $catalogModeWrapper = $meigeeOptions->​getMConfigResultByAlias('​catalog_mode'​);​
   $catalogMode = $catalogModeWrapper['​value'​]['​sv2'​]['​value'​];​   $catalogMode = $catalogModeWrapper['​value'​]['​sv2'​]['​value'​];​
  
- ​$meigeeOptions = $this->​getLayout();​ +Find out the value of ''​$catalogMode''​, and replace the variable with the actual ​value. This will make the configuration change invalid, which means you will also need to manually update here.
- ​$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: Now the new file will look like this:
  
- /* commented out due to conflict with LiteMage * +  ​/* commented out due to conflict with LiteMage * 
- * $meigeeOptions = $this->​getLayout();​ +  * $meigeeOptions = $this->​getLayout();​ 
- * $catalogModeWrapper = $meigeeOptions->​getMConfigResultByAlias('​catalog_mode'​);​ +  * $catalogModeWrapper = $meigeeOptions->​getMConfigResultByAlias('​catalog_mode'​);​ 
- * $catalogMode = $catalogModeWrapper['​value'​]['​sv2'​]['​value'​];​ */+  * $catalogMode = $catalogModeWrapper['​value'​]['​sv2'​]['​value'​];​ */
   $catalogMode = 0; // use the value directly   $catalogMode = 0; // use the value directly
  
-Seem fix the problem ​and run more testing.+This seems to fix the problem, but we need to run more testing ​just to be sure.
  
-After add to cart, and refresh, page goes blank. View html source, can see the Fatal Error output +After adding an item to cart, and refreshingthe page goes blank. View html source, ​and you 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   <​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:   Stack trace:
   #0 /​home/​yourdomain/​public_html/​app/​code/​core/​Mage/​Core/​Block/​Template.php(241):​ include()   #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- +  #1 /​home/​yourdomain/​public_html/​app/​code/​core/​Mage/​Core/​Block/​Template.php(272):​ Mage_Core_Block_Template-&​gt;​fetchView('​frontend/​feathe...'​)
- &​gt;​fetchView('​frontend/​feathe...'​)+
   #2 /​home/​yourdomain/​public_html/​app/​code/​core/​Mage/​Core/​Block/​Template.php(286):​ Mage_Core_Block_Template-&​gt;​renderView()   #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()   #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()   #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): ​ +  #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)) 
- 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 />
-  #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--> ​     <​!--Litemage esi ended cart_sidebar--> ​  
  
-Go to the file and edit vi +Go to ''​app/​design/​frontend/​feather/​default/​template/​checkout/​cart/​sidebar/​default.phtml'' ​and edit it in vi
  
 There are multiple places showing 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 +  ​Mage::app()getLayout()checkVersion('​1.7.x.x'​) ? $thishtmlEscape : $thisescapeHtml
-Is just checking if Magento version is 1.7.x, while current store is 1.9.3, so always false +
  
-Replace to  +The code ''​app/​code/​local/​Meigee/​Thememanager/​Rewrite/​Core/​Layout.php''​ is just checking if Magento version is 1.7.x. We know the current store is 1.9.3, so this check will always be false.
- $this->​escapeHtml+
  
-Problem ​fixed. Basically the steps are to locate ​problem part in Meigee ​feather ​theme and fix them.+Replace it with 
 +  
 +<​code>​$this->​escapeHtml</​code>​ 
 + 
 +We have disabled footer ESI in LiteMage in the first step, but we have further investigation on footer code. It has similar issue. 
 + 
 +app/​design/​frontend/​feather/​default/​template/​page/​html/​footer.phtml 
 + 
 +It uses the following line: 
 +  <?php echo $this->​getLayout()->​getMConfigResultByAlias('​custom_footer_block'​);​ ?> 
 +   
 +Instead of calling function getMConfigResultByAlias,​ the user can put actual content there to avoid such issue. Since it has been covered by disabling LiteMage footer ESI, we don't change it here anymore. 
 + 
 +   
 +Problem ​solved. Basicallythe steps are to locate ​the problematic code in the Meigee ​Feather ​theme and fix it.
  • Admin
  • Last modified: 2018/01/12 20:51
  • by Jackson Zhang