0

I'm using Magento 1.9.0.1 and i've created a new extension in which i've added a new tab in the admin panel take a look at the picture.

enter image description here

Here is what i have in my files.

In: /app/code/community/VivasIndustries/SmsNotification/etc/config.xml:

<?xml version="1.0"?>
<config>
 <modules>
 <VivasIndustries_SmsNotification>
 <version>0.1.0</version>
 </VivasIndustries_SmsNotification>
 </modules>
 <global>
 <models>
 <smsnotification>
 <class>VivasIndustries_SmsNotification_Model</class>
 </smsnotification>
 </models> 
 <events>
 <sales_order_save_after>
 <observers>
 <vivasindustries_smsnotification>
 <class>smsnotification/observer</class>
 <method>orderSaved</method>
 </vivasindustries_smsnotification>
 </observers>
 </sales_order_save_after>
 </events>
 <helpers>
 <smsnotification>
 <class>VivasIndustries_SmsNotification_Helper</class>
 </smsnotification>
 </helpers> 
 <adminhtml>
 <rewrite>
 <data>VivasIndustries_SmsNotification_Helper_Adminhtml_Data</data>
 </rewrite>
 </adminhtml>
 </global>
 <adminhtml>
 <acl>
 <resources>
 <all>
 <title>Allow Everything</title>
 </all>
 <admin>
 <children>
 <system>
 <children>
 <config>
 <children>
 <vivas>
 <title>Vivas - All</title>
 </vivas>
 </children>
 </config>
 </children>
 </system>
 </children>
 </admin>
 </resources>
 </acl>
 </adminhtml>
 <admin>
 <routers>
 <adminhtml>
 <args>
 <modules>
 <VivasIndustries_SmsNotification before="Mage_Adminhtml">VivasIndustries_SmsNotification_Adminhtml</VivasIndustries_SmsNotification>
 </modules>
 </args>
 </adminhtml>
 </routers>
 </admin>
</config> 

Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/etc/adminhtml.xml:

<?xml version="1.0"?>
<config>
 <menu>
 <vivassms translate="title" module="smsnotification">
 <title>SMS Center</title>
 <sort_order>110</sort_order>
 <children>
 <sendsms translate="title" module="smsnotification">
 <title>Send SMS</title>
 <action>adminhtml/magesms_sendsms</action>
 <sort_order>1</sort_order>
 </sendsms>
 <settings>
 <title>Settings</title>
 <action>adminhtml/system_config/edit/section/vivas/</action>
 <sort_order>10</sort_order>
 </settings>
 <about translate="title" module="smsnotification">
 <title>About</title>
 <action>adminhtml/smsnotification_about</action>
 <sort_order>11</sort_order>
 </about>
 </children>
 </vivassms>
 </menu>
 <acl>
 <resources>
 <admin>
 <children>
 <vivassms>
 <title>SMS</title>
 <children>
 <sendsms translate="title" module="smsnotification">
 <title>Send SMS</title>
 </sendsms>
 <settings>
 <title>Settings</title>
 <children>
 <smsprofile translate="title" module="smsnotification">
 <title>Edit user account</title>
 </smsprofile>
 </children>
 </settings>
 <about translate="title" module="smsnotification">
 <title>About</title>
 </about>
 </children>
 </vivassms>
 <system>
 <children>
 <config>
 <children>
 <vivassms translate="title" module="smsnotification">
 <title>Vivas SMS</title>
 </vivassms>
 </children>
 </config>
 </children>
 </system>
 </children>
 </admin>
 </resources>
 </acl>
</config>

Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/controllers/Adminhtml/SmsNotification/AboutController.php:

<?php
class VivasIndustries_SmsNotification_Adminhtml_AboutController extends Mage_Adminhtml_Controller_Action
{ 
 public function preDispatch() 
 { 
 return Mage_Adminhtml_Controller_Action::preDispatch(); 
 } 
 public function indexAction() 
 {
 $this->_initAction();
 $i8ee45e0018a32fb1a855b82624506e35789cc4d2 = $this->getLayout()->createBlock( 'Mage_Core_Block_Template', 'my_block_name_here', array('template' => 'vivasindustries/smsnotification/about.phtml') );
 $this->getLayout()->getBlock('content')->append($i8ee45e0018a32fb1a855b82624506e35789cc4d2); $this->renderLayout(); 
 } 
 protected function _initAction() 
 { 
 parent::_initAction(); 
 $this->_setActiveMenu('smsnotification/about') ->_title(Mage::helper('smsnotification')->__('About')); 
 return $this; 
 } 
}

Here is what i have in: /app/design/adminhtml/default/default/template/vivasindustries/smsnotification/about.phtml:

<?php
/**
 * Mage SMS - SMS notification & SMS marketing
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the BSD 3-Clause License
 * It is available through the world-wide-web at this URL:
 * http://opensource.org/licenses/BSD-3-Clause
 *
 * @category Vivas
 * @package Vivas_smsnotification
 * @copyright Copyright (c) 2012-2014 Vivas s.r.o. (http://www.mage-sms.com)
 * @license http://opensource.org/licenses/BSD-3-Clause
 */
?>
<h2>
<?php 
echo Mage::helper('smsnotification')->__('About'); ?></h2>
<b><?php echo Mage::helper('smsnotification')->__('Mage SMS module 2013-%s, version ', date('Y')).Mage::getConfig()->getModuleConfig('VivasIndustries_SmsNotification')->version; ?></b><br />
<?php echo Mage::helper('smsnotification')->__('Copyright © Vivas s.r.o., All rights reserved'); ?><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Supported Magento versions:'); ?></b><?php echo Mage::getConfig()->getNode('default/config/supported')->versions; ?><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Developer:'); ?></b><br /><?php echo Mage::helper('smsnotification')->__('Vivas s.r.o.'); ?><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Address:'); ?></b><br /><?php echo Mage::helper('smsnotification')->__('B. Nemcove 767/13'); ?><br /><?php echo Mage::helper('smsnotification')->__('78701 Sumperk'); ?><br />
<?php echo Mage::helper('smsnotification')->__('Czech Republic'); ?><br /><?php echo Mage::helper('smsnotification')->__('VAT: CZ29444268'); ?><br /><br /><b><?php echo Mage::helper('smsnotification')->__('Office Telephone:'); ?></b><br />
<?php echo Mage::helper('smsnotification')->__('+420 581 110 998'); ?><br /><br /><b><?php echo Mage::helper('smsnotification')->__('E-mail:'); ?></b><br />
<a href="mailto:<?php echo Mage::helper('smsnotification')->__('[email protected]'); ?>"><?php echo Mage::helper('smsnotification')->__('[email protected]'); ?></a><br />
<a href="mailto:<?php echo Mage::helper('smsnotification')->__('[email protected]'); ?>"><?php echo Mage::helper('smsnotification')->__('[email protected]'); ?></a><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Web:'); ?></b><br />
<a href="http://<?php echo Mage::helper('smsnotification')->__('www.mage-sms.com'); ?>"><?php echo Mage::helper('smsnotification')->__('www.mage-sms.com'); ?></a><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Facebook:'); ?></b><br /><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fmagentosms&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=false&amp;share=true&amp;height=21&amp;appId=242281502635180" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowTransparency="true"></iframe><br /><br />
<b><?php echo Mage::helper('smsnotification')->__('Manual:'); ?></b><br /><a href="http://<?php echo Mage::helper('smsnotification')->__('www.mage-sms.com/manual.html'); ?>"><?php echo Mage::helper('smsnotification')->__('www.mage-sms.com/manual.html'); ?></a><br /><br />
<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'smsnotification/Vivas-logo.gif'; ?>" alt="Vivas" />

When i try to open the About page i got error 404. Can you please help me fix this error and give me info why i got this problem?

EDIT: Image of the Error:

enter image description here

Thanks in advance!

asked Feb 6, 2015 at 19:10
2
  • The main reason I've seen for people getting 404 in the admin is due to not logging out and logging back in (to reload the ACL) after an extension install. Commented Feb 6, 2015 at 19:38
  • That is not the reason here. I got 404 at the frontend when i try to open the About page. The 404 error is not received in the Admin Panel but in the frontend which i think is awkward.. Commented Feb 6, 2015 at 19:49

1 Answer 1

1

In your config.xml you didn't close a node.

 </smsnotification>
 <adminhtml>
 <rewrite>

Should be:

 </smsnotification>
 </helpers>
 <adminhtml>
 <rewrite>

And you have the closing helpers tag in the wrong section:

 </adminhtml>
 </helpers>
 </global>

Should be:

 </adminhtml>
 </global>

EDIT:

I'm not sure why this is in there. Try removing it:

 <adminhtml>
 <rewrite>
 <data>VivasIndustries_SmsNotification_Helper_Adminhtml_Data</data>
 </rewrite>
 </adminhtml>

Also change this in your adminhtml.xml:

 <about translate="title" module="smsnotification">
 <title>About</title>
 <action>adminhtml/about</action>
 <sort_order>11</sort_order>
 </about>

Move: /app/code/community/VivasIndustries/SmsNotification/controllers/Adminhtml/SmsNotification/AboutController.php to /app/code/community/VivasIndustries/SmsNotification/controllers/Adminhtml/AboutController.php

answered Feb 7, 2015 at 5:06
9
  • I did what you suggest to me and the error is still here. Any additional advice ? Commented Feb 7, 2015 at 11:50
  • Edit your Question with your latest app/code/community/VivasIndustries/SmsNotification/etc/config.xml Commented Feb 7, 2015 at 11:52
  • Done. I've edited my question with the latest config.xml. Please check it out! Commented Feb 7, 2015 at 11:53
  • Answer edited. Try again Commented Feb 7, 2015 at 12:00
  • Try changing your adminhtml.xml <action> to adminhtml/about and drop the smsnotification Commented Feb 7, 2015 at 12:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.