PHP Magento Tips

Powered by Blogger.

Update admin routers of Custom Module After Installing Magento Security Patch Supee 6788

Rate this posting:
{[['']]}

After Installing Magento Security Patch Supee 6788, you will find some of your custom module links in backend are not working properly. You will find that links goes to 404 not found page.

This issue comes because of routing problems of your custom modules's config.xml file.

You Need To Make Following Modifications In your Custom modules config.xml file For Making it Compitible after Magento Security patch SUPEE-6788.

1. In  \app\code\community\[NameSpace]\[Modulename]\etc\config.xml find below code:

<admin>

    <routers>

        <modulename>

            <use>admin</use>

                <args>

                    <module>NameSpace_Modulename</module>

                    <frontName>modulename</frontName>

                </args>

        </modulename>

    </routers>

</admin>

And replace it with Below code:

<admin>

    <routers>

        <adminhtml>

            <args>

                <modules>

                    <modulename before="Mage_Adminhtml">NameSpace_Modulename_Adminhtml</modulename>

                </modules>

            </args>

        </adminhtml>

    </routers>       

</admin>

2. You also Need To Change Menu Action modulename/adminhtml_controllername/action To adminhtml/controllername/action.

<menu>

 <children>

   <modulename translate="title" module="modulename">

    <title>Menu Item</title>

    <sort_order>50</sort_order>

    <action>modulename/adminhtml_controllername/action</action>

   </modulename>

 </children>

</menu>

Need to changed it to this:

<menu>


 <children>


   <modulename translate="title" module="modulename">


    <title>Menu Item</title>


    <sort_order>50</sort_order>


    <action>adminhtml/controllername/action</action>


   </modulename>


 </children>


</menu>

After change upto this, you will find your 404 not found links are working fine. But may be possible you are not able to see any content on that page.

for that you need to modified your module layout.xml (app\design\adminhtml\default\default\layout\custommodule.xml) files.

<xml version="1.0"?>

<layout version="0.1.0">

    <modulename_adminhtml_controllername_action>

        <reference name="content">

            ...

        </reference>

    </modulename_adminhtml_controllername_action>

</layout>

Need to changed it to this:

<xml version="1.0"?>

<layout version="0.1.0">

    <adminhtml_controllername_action>

        <reference name="content">

            ...

        </reference>

    </adminhtml_controllername_action>

</layout>

You will also find some affected Plugin which Uses Custom Block and Variables.

SUPEE-6788 Custom Blocks (and Variables) Issue

Issue:

  • Some blocks are not shown on CMS pages, home page, category pages, landing pages in your Magento installation after installing SUPEE-6788 patch, page layout is broken.
  • Some transactional emails, order notification emails are broken, incomplete or have some data missing after installing SUPEE-6788 patch.

Solutions:

By default, only two blocks (core/template and catalog/product_new) are allowed for inclusion. So we need to add our extension’s custom block in blocks permission table.

Upgrade your custom module’s sql script as follow.

$installer = $this; $installer->startSetup();
 
if(in_array($this->getTable('permission_block'),$installer->getConnection()->listTables())){
$installer->run("
    INSERT INTO {$this->getTable('permission_block')} (block_name,is_allowed) values ('custommodule/customblock','1');
    INSERT INTO {$this->getTable('permission_variable')} (variable_name,is_allowed) values ('custom_variable_name','1');
");
}
$installer->endSetup(); 
?>

You can manually add custom block and custom variable values which we need to use in the CMS > Pages or CMS > Static Blocks or System > Transactional Emails.

For Adding Custom block or Custom variable Go To System > Permissions > Blocks and Click On Add New block.


  1. Add block Name like “custommodule/customblock”.
  2. Set Is Allowed to “Yes”.
Tag : Magento
1 Comments On "Update admin routers of Custom Module After Installing Magento Security Patch Supee 6788"

Binance wallet and exchange is popular in the world with a market capitalization of massive number in such a short span. If you are facing trouble while sending cryptocurrency to another wallet in the Binance exchange, you can call on Binance support phone number 1(833)-464-7652 which is functional and users can have conversation with the team anytime related to trouble. Reach the team and get rid of troubles immediately from the roots in no time. The team is always by your side and help in fixing all your troubles immediately.

Back To Top