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?
muzall in lowercase – Jimmery Aug 03 '15 at 16:06isAllowedmethod 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:27isAllowedmethod, 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