0

On October 22, 2015, Magento will release security patch SUPEE-6788. According to the technical details, 4 APPSEC's that have been fixed require some rework in local and community modules. I'm trying to fix one on my modules but cant seem to get the admin routing working correctly. The extension pages cant be found anymore (404). Here are my files ...

\app\code\community\SolideWebservices\Flexslider\etc\config.xml contains:

        <routers>
        <adminhtml>
            <args>
                <modules>
                    <flexslider after="Mage_Adminhtml">SolideWebservices_Flexslider_Adminhtml</flexslider>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

\app\code\community\SolideWebservices\Flexslider\etc\admin.xml contains:

<menu>
    <cms>
        <children>
            <flexslider translate="title" module="flexslider">
                <title>Flexslider</title>
                <sort_order>100</sort_order>
                <children>
                    <group>
                        <title>Manage Groups</title>
                        <sort_order>101</sort_order>
                        <action>adminhtml/flexslider/group</action>
                    </group>
                    <slide>
                        <title>Manage Slides</title>
                        <sort_order>102</sort_order>
                        <action>adminhtml/flexslider/slide</action>
                    </slide>
                </children>
            </flexslider>
        </children>
    </cms>
</menu>

And there are two controllers:

\app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\GroupController.php

class SolideWebservices_Flexslider_Adminhtml_GroupController extends Mage_Adminhtml_Controller_Action {

protected function _initAction() {
    $this->loadLayout();
    $this->_setActiveMenu('cms/flexslider');
    return $this;
}

public function indexAction() {
    $this->_initAction();
    $this->_addContent($this->getLayout()->createBlock('flexslider/adminhtml_group'));
    $this->renderLayout();
} ......

\app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\SlideController.php

class SolideWebservices_Flexslider_Adminhtml_SlideController extends Mage_Adminhtml_Controller_Action {

protected function _initAction() {
    $this->loadLayout();
    $this->_setActiveMenu('cms/flexslider');
    return $this;
}

public function indexAction() {
    $this->_initAction();
    $this->renderLayout();
}

protected function _isAllowed() {
    return Mage::getSingleton('admin/session')->isAllowed('cms/flexslider/slide');
} ....

What's going on, why is the admin routing not working?

2 Answers 2

1

Ok, I have it working again. This is how I fixed it:

\app\code\community\SolideWebservices\Flexslider\etc\config.xml contains:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <SolideWebservices_Flexslider after="Mage_Adminhtml">SolideWebservices_Flexslider_Adminhtml</SolideWebservices_Flexslider>
               </modules>
           </args>
       </adminhtml>
    </routers>
</admin>

\app\code\community\SolideWebservices\Flexslider\etc\admin.xml contains:

                    <group>
                        <title>Manage Groups</title>
                        <sort_order>101</sort_order>
                        <action>adminhtml/flexslidergroup</action>
                    </group>
                    <slide>
                        <title>Manage Slides</title>
                        <sort_order>102</sort_order>
                        <action>adminhtml/flexsliderslide</action>
                    </slide>

And I renaned the controllers to FlexslidergroupController.php and FlexsliderslideController.php. I could have used "adminhtml/group" and "adminhtml/slide" but as these terms are generic there would be a risk of a conflict so I decided to change the name of the routing URL.

I had to fix some other small stuff as well in the admin layout xml file (located in app/design/adminhtml/defaul/default/layout/custommodule.xml) to reflect the new URL. There where references that had to be updated for instance ... became ... etc.

2
  • would be helpful if you could complete your answer. thanks Commented Oct 28, 2015 at 16:55
  • There is not much more to say but I have added a little more explanation.
    – Solide
    Commented Oct 28, 2015 at 19:15
0

The patch your talking about was revoked by magento but its good that you are looking at your modules just in case they do release it again. First in your config.xml it should be:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <flexslider after="Mage_Adminhtml">SolideWebservices_Flexslider_Adminhtml</flexslider>
               </modules>
           </args>
       </adminhtml>
    </routers>
</admin>

Also in your adminhtml.xml you're declaring the route adminhtml/flexslider/group so your controller should be \app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\FlexsliderController.php with the method of groupAction()

EDIT In order to have your slider and group controller separate you could update your admin.xml to use the following:

<action>adminhtml/flexslider_group</action>

This should then use \app\code\community\SolideWebservices\Flexslider\controllers\Adminhtml\Flexslider\GroupController.php and the indexAction()

5
  • Thank you for the response, I have seen Magento has posponed the patch and will built in a feature toggle for this security fix but as I understand it it will still be released and will still effect the admin routing when enabling the fix.The admin.xml was a copy and past error. I currently have two controllers (GroupController and SlideController) with their own methods like newAction, saveAction etc.. Isnt there a way to keep these two seperate controllers instead of have to merge them into one file (how would I have to handle the newAction, saveAction in thise case).
    – Solide
    Commented Oct 23, 2015 at 6:07
  • @Solide so the admin.xml you pasting in the question is wrong?
    – rob3000
    Commented Oct 23, 2015 at 6:17
  • Perhaps, I'm trying to figure out what is wrong here ... I'm coming from a situation using <use>admin</use> in config.xml and using <action>/flexslider/adminhtml_group</action> and <action>/flexslider/adminhtml_slide</action> as links in admin.xml. This allowed me to create menu items which have their own controller (GroupController.php for managing groups and SlideController.php for managing slides). I would like to keep these seperate controllers but dont know how to set up config.xml and admin.xml for this to route correctly. What i added in the question was my idea but is not working ...
    – Solide
    Commented Oct 23, 2015 at 10:37
  • @Solide just updated my answer
    – rob3000
    Commented Oct 25, 2015 at 2:26
  • Thanks for the effort Rob. I have updated admin.xml as you mentioned but I still get the 404 from the menu. Would you be willing to look at the extension itself, I'm obviously overlooking something and it's driving me crazy.
    – Solide
    Commented Oct 25, 2015 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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