1

After a forced server update to php5.5 we have been faced with this error below:

Method "addLibrary" is not defined in "Meigee_ThemeOptions_Controller_Observer"

#0 /home/user/website.com/app/code/core/Mage/Core/Model/App.php(1340): Mage::throwException('Method "addLibr...')
#1 /home/user/website.com/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Meigee_ThemeOptions_Controller_Observer), 'addLibrary', Object(Varien_Event_Observer))
#2 /home/user/website.com/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#3 /home/user/website.com/app/code/core/Mage/Core/Controller/Varien/Action.php(351): Mage::dispatchEvent('controller_acti...', Array)
#4 /home/user/website.com/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#5 /home/user/website.com/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#6 /home/user/website.com/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#7 /home/user/website.com/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Cms_IndexController->indexAction()
#8 /home/user/website.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#9 /home/user/website.com/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home/user/website.com/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home/user/website.com/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#12 /home/user/website.com/index.php(86): Mage::run('', 'store')
#13 {main}

Obviously it is a theme issue, but what should I be looking at to fix it?

EDIT: In response to the below answer, I can't access admin section either, I get the same error. Here is the relevant config.xml file in case that helps.

<?xml version="1.0"?>
<config>
    <modules>
        <Meigee_ThemeOptions>
            <version>1.0.0</version>
            <depends>
            <!-- no dependencies -->
            </depends>
        </Meigee_ThemeOptions>
    </modules> 
    <global>
        <models>
            <!-- ... -->
            <ThemeOptions>
                <class>Meigee_ThemeOptions_Model</class>
            </ThemeOptions>   
            <!-- ... -->
        </models>
        <events>
          <adminhtml_controller_action_predispatch_start>
            <observers>
              <Meigee_ThemeOptions_observer>
                <type>singleton</type>
                <!-- inchooadminthemecontroller/observer  -->
                <class>Meigee_ThemeOptions_Controller_Observer</class>
                <method>overrideTheme</method>
              </Meigee_ThemeOptions_observer>
            </observers>
          </adminhtml_controller_action_predispatch_start>  
        <controller_action_layout_generate_blocks_after>
            <observers>
                <ibanner_layout_generate_observer>
                    <type>singleton</type>
                    <class>Meigee_ThemeOptions_Controller_Observer</class>
                    <method>addLibrary</method>
                </ibanner_layout_generate_observer>
            </observers>
        </controller_action_layout_generate_blocks_after>    
        </events>
        <helpers>
            <ThemeOptions>
                <class>Meigee_ThemeOptions_Helper</class>
            </ThemeOptions>
        </helpers>
        <extraconfig />
        <blocks>
            <meigee_themeoptions>
                    <class>Meigee_ThemeOptions_Block</class>
            </meigee_themeoptions>
            <meigee_general><class>Meigee_ThemeOptions_Block</class></meigee_general>
            <meigee_productpage><class>Meigee_ThemeOptions_Block</class></meigee_productpage>
            <meigee_sidebar><class>Meigee_ThemeOptions_Block</class></meigee_sidebar>
            <themeoptions>
                    <class>Meigee_ThemeOptions_Block</class>
                    <rewrite>
                        <bestsellers>Meigee_ThemeOptions_Block_Bestsellers</bestsellers>
                    </rewrite>
            </themeoptions>
        </blocks>
    </global>
    <!---->
    <default>
        <meigee_general>
            <appearance>
                <font>0</font>
                <default_sizes>1</default_sizes>
                <fontsize>14</fontsize>             
                <lineheight>24</lineheight>
                <fontweight>400</fontweight>
                <patern>pandora</patern>
            </appearance>
            <layout>
                <sidebar>sidebar_right</sidebar>
                <grid>grid_standard</grid>
                <cartpage>cart_accordion</cartpage>
            </layout>
            <menu>
                <type>menu_wide</type>
                <home>1</home>
            </menu>
            <otheroptions>
                <totop>1</totop>
                <labelnew>1</labelnew>
            </otheroptions>
            <lang_switcher>
                <status>language_select</status>
                <label>0</label>
            </lang_switcher>
            <curr_switcher>
                <status>currency_images</status>
                <label>0</label>
            </curr_switcher>
            <fancybox>
                <fancybox_status>1</fancybox_status>
                <fancybox_home>1</fancybox_home>
                <fancybox_listing>1</fancybox_listing>
            </fancybox>
        </meigee_general>
        <meigee_productpage>
            <productpage>
                <prevnext>prevnext</prevnext>
                <moreviews>moreviews_slider</moreviews>
                <collateral>collateral_tabs</collateral>
                <collateral_related>related_slider</collateral_related>
            </productpage>
        </meigee_productpage>
        <meigee_sidebar>
            <block_categories>
                <status>1</status>
                <option>1</option>
                <option_2>1</option_2>
            </block_categories>
            <block_shop_by>
                <status>1</status>
                <option>1</option>
                <option_2>1</option_2>
            </block_shop_by>
            <block_compare>
                <status>1</status>
            </block_compare>
            <block_compared>
                <status>1</status>
            </block_compared>
            <block_viewed>
                <status>1</status>
            </block_viewed>
            <block_wishlist>
                <status>1</status>
                <option>1</option>
            </block_wishlist>
            <block_tags>
                <status>1</status>
            </block_tags>
            <block_orders>
                <status>1</status>
            </block_orders>         
        </meigee_sidebar>
    </default>
</config>

EDIT 2: Tried disabling the module by the Meigee_ThemeOptions.xml file, still getting the same error:

<?xml version="1.0"?>
<config>
   <modules>
      <Meigee_ThemeOptions>
         <active>false</active>
         <codePool>local</codePool>
      </Meigee_ThemeOptions>   
   </modules>
</config>

EDIT 3: Developer mode should be off. The index.php file has the below lines:

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
    ini_set('display_errors', 1);
}
else
{
    Mage::setIsDeveloperMode(false);
    ini_set('display_errors', 0);
}

And .htaccess file has the line SetEnv MAGE_IS_DEVELOPER_MODE "false"

I added the line to htaccess file because I did turn on developer mode (by commenting out the if statement) to get some error logs but don't think it has turned off correctly...Any help with that would be appreciated.

  • AFAIK, you only get this error when you have developer mode enabled, otherwise the missing method is simply ignored. Are we talking about a production server? Are you sure you want to have developer mode on there? – fmrng May 2 '16 at 21:56
  • See edit above, don't know how to turn off developer mode correctly. – anothershrubery May 2 '16 at 22:07
  • Simply remove the line from the .htaccess or comment it out with #, since Magento is checking if the env variable is set, not if it's true or false. That should turn off dev mode. – fmrng May 2 '16 at 22:09
  • I only added that line because it wasn't working, but removing that line has worked now. If you add this as an answer, I will accept it. – anothershrubery May 2 '16 at 22:14
  • Good to hear! I hope this solves your problem though, since the problem with the missing observer method still remains. Did you check if there's a class Meigee_ThemeOptions_Controller_Observer declared somewhere? What is its file path? – fmrng May 2 '16 at 22:30
4
+50

This error is only displayed when you have developer mode on. Leaving developer mode on a production server is really not recommended, since you run the risk of exposing your shop structure and could possibly lead to vulnerabilities, attacks, etc. Make sure you turn developer mode off by making sure the environment variable MAGE_IS_DEVELOPER_MODE is not set.

Please notice: not set means that the variable is not declared, since Magento is checking for its presence, not whethere it's true or false or any value.

1

Looks like if you have an event observer defined - I guess in one of the 3rd-party-modules. It looks like there is empty method registered for the event.

Please check observer listening on event in extension's config.xml. Try disabling the module and check again.

  • Why would this change just because of the php version upgrade? It says this is to do with the Meigee Theme, not really an extension? Where would the confg.xml file be? What would I do with it? I can't get into the admin area, same error, so how do I disable the module? Don't want to turn off the them as it defines how the site looks. – anothershrubery May 2 '16 at 21:04
  • See above edit for config.xml file. – anothershrubery May 2 '16 at 21:40
  • you can disable theme extension directly from file without login in admin – Yeshu May 2 '16 at 21:40
  • Can you expand on how I can do that? Will it affect the functionality/look of the site? – anothershrubery May 2 '16 at 21:41
  • go to app/etc/modules/Meigee_ThemeOptions.xml and change true to false. Save it and check on frontend. Yes, it will disable extension functionality. You can reupload that extension code. I had same issue and I fixed by this way. – Yeshu May 2 '16 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.