5

Whenever i click to System->Configuration then above error is displayed. What should i do to resolve it.

Please help me out.

  • Have you setup any modules which are related to 'Blog' module? As far as I know, Magento 1.x default doesn't have Blog Module. – Khoa TruongDinh May 21 '16 at 16:00
2

TL;DR:

Part of your XML references a module called "Blog". There is a module tag in system XML files which looks for a helper in the module you specify, which you may have used without knowing its purpose.

Find this:

module="blog"

And remove it from your XML. It's not required and causes this error when you don't have a helper in that module.


To clarify a little, there seems to be some conflicting opinions around what the actual problem is here and what the best way to handle it is.

Problem

You reference module="blog" in one of your XML definitions.

This means that Magento will process this value and try and resolve a helper alias from it, in the same way as Mage::helper('blog'). You can see examples of where this happens here, here and here.

If the helper alias is unresolved at the end of the process, Magento will look last in the Mage namespace, which is why you see Mage_Blog in the output.

If we look at the smallest example from those linked above you can see that there is a default value of adminhtml defined, and it is only overridden when trying to find a helper if you define one using the module attribute:

# File: app/code/core/Mage/Admin/Model/Config.php
/**
 * Get menu item label by item path
 *
 * @param string $path
 * @return string
 */
public function getMenuItemLabel($path)
{
    $moduleName = 'adminhtml';     // <------------ important!
    $menuNode = $this->getAdminhtmlConfig()->getNode('menu/' . str_replace('/', '/children/', trim($path, '/')));
    if ($menuNode->getAttribute('module')) {
        $moduleName = (string)$menuNode->getAttribute('module');
    }
    return Mage::helper($moduleName)->__((string)$menuNode->title);
}

Purpose

Providing a specific helper using the module attribute allows you to control how translations are handled within a layout.

Fix

The fix depends on your situation:

  • If you did not intend to provide translated content in a module, you probably did this by accident. To fix, remove module="blog" from your XML configuration file.
  • If you did intend to, you must have just forgotten to create the helper you're referencing. In this case, do what Adarsh suggested. Keep in mind his suggestion about using a customised namespace (other than Mage).
  • 2
    Right answer except that it's module="blog" what you should look for. Magento automatically assumes the "Mage" namespace if the module is not found. – Fabian Schmengler May 22 '16 at 20:33
  • @fschmengler you're right - n98-magerun.phar dev:class:lookup helper blog returns Class Mage_Blog_Helper_Data dpoes not exist! - edited answer – Robbie Averill May 22 '16 at 20:49
-2

This means helper file for module Blog is missing.

I believe this is third party module not core.

You can go to your app/code/community or app/code/local to find where this module is residing.

Now, go to app/[local or community]/Mage/Blog and create a folder called Helper and inside this folder a file called Data.php with following content:

<?php 
class Mage_Blog_Helper_Data extends Mage_Core_Helper_Abstract
{
}

This should fix the trouble.

Important

If you have written this module then you shouldn't name your NameSpace to match with magento core NameSpaces. Mage is basically magento core NameSpace. Naming same will trigger issues in future. It's not best practise.

  • 1
    Hi Adarsh, I've down voted this answer because your suggestion is just hiding the error message essentially. Better would be to find the part of XML that refers to 'module="mage_blog"' and remove it as it's obviously custom made and incorrect – Robbie Averill May 22 '16 at 4:49
  • It's not hiding the problem, when you use 'module ="mage_blog" in your xml or also use translation, then you need this file. It's recommended to have this file in every module to be in safe side. You should do some research. – Adarsh Khatri May 22 '16 at 6:13
  • Helpers are not required (unless you use that tag, which is normally done while copy and pasting). There is no "safe side" with programming. You either require something or you don't. In this case that tag introduces a dependency on a helper in the module you reference, but if you omit the tag and the helper does exist Magento still behaves exactly the same. Consider it like implementing an interface, only magento doesn't tell you you missed until you do certain things with it. – Robbie Averill May 22 '16 at 6:16
  • Can you explain why module="your module" is used in xml in Magento? – Adarsh Khatri May 22 '16 at 6:23
  • Sure - look here, here and here for examples of how Magento parses the module attribute and tries to resolve a helper for it. You will see in each case that there is a default value, so you don't need to set this value. – Robbie Averill May 22 '16 at 20:17

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.