Bug behind before/after=”Mage_Adminhtml” in Magento

Posted on May 5th, 2015 | Posted by admin

Since Magento CE 1.3.0 version, creating Magento admin controller required you to specify before=”Mage_Adminhtml” or after=”Mage_Adminhtml” attribute for your node atadmin/routers/adminhtml/args/modules XML Path, depending on type of behavior you want to achieve. Like me, you probably have doubts on why this is necessary, and what is the background of this requirement? Simple answer would be that without it, it simply doesn’t work. More precisely, Magento hits you right in the schnoz with 404 after you try accessing admin controller in question, if you don’t set one of these attributes at your node. In this article I’ll do my best to explain bug in Magento standard router causing this behavior, one that somehow managed to get packaged with last 25+ Magento CE versions without being noticed.

Yesterday my team came to conclusion that Enterprise_Rma module contains a bug, because code snippet registering it’s admin controller has missing before/after attribute at relevant node in config.xml, what causes 404 in Magento admin. Here’s an excerpt from config.xml:

Magetno user role / acl saving problem in admin

Posted on December 24th, 2012 | Posted by admin

If you are facing a problem like in magento admin you can’t save acl information for api / admin user, here is the solution :-

For Api User overwrite the constructor of the block Mage_Adminhtml_Block_Api_Tab_Rolesedit with following function :

Magento 1.5 Admin – categories tree for product does not expand to show sub-categories

Posted on November 23rd, 2012 | Posted by admin

When i have open products in edit mode in Magento 1.5 Admin then categories tree for product does not expand to show product sub-categories… Only Root categories were visible…

I couldn’t find proper solution for this problem… But i did patch which worked perfectly for me. Hope this will help to someone else too…


There is some change in Categories.php file of magento 1.4.2 and 1.5.x

So,i have backed up old Categories.php in:

How to display Image Preview in Admin Form magento

Posted on January 28th, 2012 | Posted by admin

Magento allows us to create custom form in admin panel by creating our own custom module. We can create almost any field in the admin form by creating a class that extends the base class Mage_Adminhtml_Block_Widget_Form. The _prepareForm method allows to define our form elements.
Sometimes we may need to upload a file in the adminform, the default file field doesn’t provide the image preview when we upload an image file. For this purpose we need to use image field type as shown in the below snippet

$fieldset->addField('filename', 'image', array(
'label' => Mage::helper('customform')->__('Image'),
'required' => false,
'name' => 'filename',

How to add additional row limit count in magento admin grid

Posted on January 16th, 2012 | Posted by admin

Magento Provides the Grid Based Layout in adminpanel pages for most of the pages like manage customers,manage products etc. The default row limit options are 20,50,100,200 etc per page. But for the stores with more than 1000 products and customers these options are not sufficient to display the records in less no. of pages.

Step 1: For this example we are going to add an additonal row limit count as 500. To do this locate the file which is reponsible for showing row count dropdown. The file is located in


Step 2: Around line 81 the code is located as shown below

Page 1 of 3123»