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

<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?

  • 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? – Renon Stewart Aug 3 '15 at 15:53
  • When I click on a menu (and yes, definitely logged out and back in several times) – Jimmery Aug 3 '15 at 15:59
  • Can you add your config.xml? Also is the module enabled? Should this be '/muz' or '/Muz'? – Renon Stewart Aug 3 '15 at 16:01
  • module is enabled. should be muz all in lowercase – Jimmery Aug 3 '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 3 '15 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.