cancel
Showing results for 
Search instead for 
Did you mean: 

Local folder content not working in Magento 1.9.3.2

Local folder content not working in Magento 1.9.3.2

Hi,

I have a Magento website and I have customised the CategoryController.php

 

Location:

app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php

 

As it is a core file I have put the customised file in the local folder location.

 

Local folder path:

app/code/local/Mage/Adminhtml/controllers/Catalog/CategoryController.php

 

Till the website using Magento 1.9.3.1 this was working fine, after I upgrade to Magento to 1.9.3.2 the file in the local folder is not working and the website works properly only if I do the customisation on the core files.

I tried resetting the permissions, cleared cache and it did not help.

Does anyone know why my local folder is not working and anythings else i need to check on the website?

 

Regards,

-Ragav

1 REPLY 1

Re: Local folder content not working in Magento 1.9.3.2

Copying files to the local code pool will only work for blocks, helpers and models. You cannot override controllers using this method since they are not autoloaded like the other classes.

 

So the only way to do it is via custom module. You will need following definition in your config.xml

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Foo_Bar before="Mage_Adminhtml">Foo_Bar_Adminhtml</Foo_Bar>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

And in your controller class you need to add this:

require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Catalog' . DS . 'CategoryController.php';
class Foo_Bar_Adminhtml_IndexController extends Mage_Adminhtml_Catalog_CategoryController
{

Your controller class should be in local/Foo/Bar/controllers/Adminhtml/Catalog/CategoryController.php

 

It should be straightforward, let me know if you face any issue.

 

If this response was helpful to you, consider giving kudos to this post.

If this response solved your problem, click accept as solution to help others solve this issue

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue