0

We have a Magento Extension on our website, written by an ex-employee. This extension was written just for this one website, and I am struggling to find out what is going wrong with this extension. Contacting the ex-employee has proven to be (how should I put this), an ineffective method for solving this problem, so I was hoping someone here could help me out.

The extension works fine on the site, but when we click on the extension in the backend, on the Admin Panel, we get a "404 Not Found 1" error.

  • Is there anything I can do (like changing log file settings) to find out what file is missing and causing this 404?

The extension itself has the following files:

\app\code\local\muz\Worldman\controllers\
    WorldmanController.php

\app\code\local\muz\Worldman\controllers\Adminhtml\
    WorldmanController.php

\app\code\local\muz\Worldman\controllers\etc
    config.xml

\app\code\local\muz\Worldman\controllers\Helper
    Data.php

I can make changes to the class names in the \app\code\local\muz\Worldman\controllers\Adminhtml\WorldmanController.php and instead of getting a 404 error, I get an actual crash report, stating that Controller file was loaded but class does not exist.

Again, this extension works fine on the site itself. Its just clicking on the extension itself from the Admin Panel that causes the 404. Indexes have been re-indexed. Caches have been cleared and turned off.

At this point any suggestions for debugging any Magento extensions would be very much appreciated.

EDIT:

as requested, here is my config.xml file:

        1.0.0

</p>

<global>
    <helpers>
        <worldman>
            <class>muz_Worldman_Helper</class>
        </worldman>
    </helpers>
</global>

<frontend>
    <routers>
        <worldman>
            <use>standard</use>
            <args>
                <module>muz_Worldman</module>
                <frontName>worldman</frontName>
            </args>
        </worldman>
    </routers>
    <layout>
        <updates>
            <worldman>
                <file>worldman.xml</file>
            </worldman>
        </updates>
    </layout>
</frontend> 

<adminhtml>
    <menu>
        <cms>
            <children>       
                <worldman_adminform translate="title" module="worldman">
                    <title>Worldman Manager</title>
                    <action>worldman/adminhtml_worldman</action>
                </worldman_adminform>                       
            </children>
        </cms>         
    </menu>

    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>          
            <admin>
                <children>
                    <cms>
                        <children>
                            <worldman_adminform> 
                                <title>worldman Manager</title>
                            </worldman_adminform>
                        </children>
                    </cms>
                </children>
            </admin>
        </resources>
    </acl>

    <layout>
        <updates>
            <worldman>
                <file>worldman.xml</file>
            </worldman>
        </updates>
    </layout>
</adminhtml>    

EDIT 2:

As requested, here is the Admin Controllers file:

<?php 

class muz_Worldman_Adminhtml_WorldmanController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()   
    {       
        if($deleteRegionId = $this->getRequest()->getParam('deleteRegion'))
        {
            Mage::helper('worldman')->deleteRegion((int) $deleteRegionId);
            $this->_getSession()->addMessage(Mage::getSingleton('core/message')->success('Region successfully deleted.'));
        }

        if($deleteLocationId = $this->getRequest()->getParam('delete'))
        {
            Mage::helper('worldman')->deleteLocation((int) $deleteLocationId);
            $this->_getSession()->addMessage(Mage::getSingleton('core/message')->success('Location successfully deleted.'));
        }

        $this->loadLayout()->renderLayout();
    }

    public function newAction() 
    {           
        $this->loadLayout()->renderLayout();
    }   

    public function editAction()
    {
        $this->loadLayout()->renderLayout();    
    }

    public function regionAction()
    {
        $this->loadLayout()->renderLayout();    
    }   

    /* Used for regions */
    public function saveAction()
    {
        $db = Mage::getSingleton('core/resource')->getConnection('core_write');
        $session = $this->_getSession();    

        $regionName = filter_var($this->getRequest()->getParam('region_name'), FILTER_SANITIZE_STRING);
        $regionSort = (int) $this->getRequest()->getParam('region_order');

        if($id = $this->getRequest()->getParam('id'))           
        {
            $sql = "update muz_worldman_regions set 
                    region_name = '$regionName', 
                    region_order = '$regionSort'
                     where region_id = '" . (int) $id . "' limit 1";

            $db->query($sql);
        }
        else
        {   
            $sql = "insert into muz_worldman_regions
                    (region_name, region_order)
                    values
                    ('$regionName', '$regionSort')";

            $db->query($sql);
        }

        $session->addMessage(Mage::getSingleton('core/message')->success('Region successfully saved.'));
        $this->loadLayout()->renderLayout();        
    }

    /* Used for locations */
    public function postAction()    
    {       
        $db = Mage::getSingleton('core/resource')->getConnection('core_write');
        $session = $this->_getSession();        

        $countryName = $this->getRequest()->getParam('country_name');
        $regionId = $this->getRequest()->getParam('region_id');
        $countryContent = $this->getRequest()->getParam('country_content');
        $countryOrder = $this->getRequest()->getParam('country_order');
        $slug = Mage::helper('worldman')->slugify($countryName);

        if($id = $this->getRequest()->getParam('id'))
        {
            $sql = "update muz_worldman_countries set 
                    country_name = '$countryName',
                    country_content = '$countryContent',
                    country_slug = '$slug',
                    region_id = '$regionId',
                    country_order = '$countryOrder'
                    where country_id = '$id' limit 1";

            $db->query($sql);                   
        }
        else
        {
            $sql = "insert into muz_worldman_countries 
                    (country_name, country_content, country_slug, region_id, country_order) 
                    values
                    ('$countryName', '$countryContent', '$slug', '$regionId', '$countryOrder')";

            $db->query($sql);               
        }

        $session->addMessage(Mage::getSingleton('core/message')->success('Location successfully saved.'));
        $this->loadLayout()->renderLayout();
    }       
}

EDIT:

This problem existed before the patch SUPEE-6285. The solutions that work around this patch does not solve this issue.

In addition to reindexing and clearing caches, we have set the entire site to 777 permissions (just to try and eliminate this issue being one of permissions), we have enabled all the logging we can, we have put the _isAllowed() code into the extension.

We have just rolled back all the recent patches. This extension works before patch 5994. Is there anything in patch 5994 that could point the way to fixing this extension?

Jimmery
  • 1,509
  • 5
  • 24
  • 38
  • 1
    Did you try log out and log back in? Where in the backend are you getting 404, system config or when you click on a menu? – MagePal Extensions Aug 03 '15 at 15:53
  • When I click on a menu (and yes, definitely logged out and back in several times) – Jimmery Aug 03 '15 at 15:59
  • Can you add your config.xml? Also is the module enabled? Should this be '/muz' or '/Muz'? – MagePal Extensions Aug 03 '15 at 16:01
  • module is enabled. should be muz all in lowercase – Jimmery Aug 03 '15 at 16:06
  • 1
    Does the module have an adminhtml.xml file in etc/ folder, with ACL resource definitions, or at least does the controller implement an isAllowed method that returns true? There's a recent Magento security patch that changed the default policy for admin controllers to deny. – Adi Aug 03 '15 at 16:27
  • What url display in the browser address bar www.site.com/worldman/xyz? – MagePal Extensions Aug 03 '15 at 16:30
  • the url is: index.php/worldman/adminhtml_worldman/index/key/9557bf690763a3fe7378e382794c7061/ – Jimmery Aug 03 '15 at 16:38
  • @AdrianCiobanu the extension only has the files ive listed above. Ive recently been upgrading all of our extensions with the isAllowed method, and yes, this extension is "allowed". However the extensions weren't "allowed" weren't producing 404 errors for me. – Jimmery Aug 03 '15 at 16:42
  • Ok, can you post the controller file please? At least the class definition part. /Edit: Btw, you're missing an admin/routers node from config.xml, to register the route to your controller for the admin. – Adi Aug 03 '15 at 16:45
  • @AdrianCiobanu do you think that node is what is causing the 404? The controller file has been added. – Jimmery Aug 03 '15 at 16:56
  • There's a high chance that the missing node is causing the issue, since the route is not registered on the admin scope. The controller file might also have issues like an incorrect class name for instance. – Adi Aug 03 '15 at 17:01
  • @AdrianCiobanu can you please leave an answer with an example of that missing node. I desperately need to get this extension working as soon as possible. – Jimmery Aug 04 '15 at 13:07
  • @FabianBlechschmidt and anyone else who is saying this is a duplicate. We have rolled back the patch SUPEE-6285, and we still get this error. I have followed the answer in the post you think this is a duplicate of, and I still get this error. Could you please consider removing the duplication of this question, this problem pre-date this patch coming out. Many thank. – Jimmery Aug 04 '15 at 13:09

0 Answers0