Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Admin crashes when I create new module (system.xml problem)
 
Netismine
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-10-28
 

Hi, I created a new module, under new namespace. My module is Implementek_InviteFriend and this is my system.xml file:

<?xml version="1.0"?>

<config>
   <
sections>
        <
invitefriend translate="label" module="invitefriend">
            <
label>Invite a Friend</label>
            <
tab>catalog</tab>
            <
frontend_type>text</frontend_type>
            <
sort_order>220</sort_order>
            <
show_in_default>1</show_in_default>
            <
show_in_website>1</show_in_website>
            <
show_in_store>1</show_in_store>
            <
groups>
                <
email translate="label">
                    <
label>Email templates</label>
                    <
sort_order>1</sort_order>
                    <
show_in_default>1</show_in_default>
                    <
show_in_website>1</show_in_website>
                    <
show_in_store>1</show_in_store>
                    <
fields>
                        <
message translate="label">
                            <
label>Message</label>
                            <
frontend_type>textarea</frontend_type>
                            <
sort_order>1</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>1</show_in_store>
                        </
message>
                    </
fields>
                </
email>
            </
groups>
        </
invitefriend>
    </
sections>
</
config>

however, it crashes my admin:

Fatal error: Class ‘Mage_Invitefriend_Helper_Data’ not found in C:\wamp\www\coffee\app\code\core\Mage\Core\Model\App.php on line 831

what am I doing wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netismine
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-10-28
 

when I remove system.xml file, everything works and I see my module in admin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netismine
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-10-28
 

is noone willing to help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Aponline
Jr. Member
 
Total Posts:  12
Joined:  2008-11-01
 

I have same problem…

Anyone help with it?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Aponline
Jr. Member
 
Total Posts:  12
Joined:  2008-11-01
 

Hi…

I solved this..

In begin of xml file add this coments, making desirable changes…

<!--
/*
* Magento YourCompany Page
*
* @category YourCompany
* @package YourCompany_YourModule
* @copyright Copyright (c) 2009
* @author bla bla
*@licence bla bla
*/
-->

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Get rid of your empty line spacing. The comments aren’t required.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netismine
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-10-28
 

The problem here is that you cannot create a new “tab” in left hand admin menu, without giving that tab specific controllers etc (that simple modules don’t have). .. so the only way to integrate simple module to admin is either to create all that controllers and stuff or to put it in some other tab .. like I did here :

<config>
   <
sections>
        <
sendfriend>
            <
groups>
                <
invite translate="label">
                    <
label>Invite a Friend</label>
                    <
sort_order>1</sort_order>
                    <
show_in_default>1</show_in_default>
                    <
show_in_website>1</show_in_website>
                    <
show_in_store>1</show_in_store>
                    <
fields>
                        <
invite_message translate="label">
                            <
label>Message</label>
                            <
frontend_type>textarea</frontend_type>
                            <
sort_order>1</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>1</show_in_store>
                        </
invite_message>
                    </
fields>
                </
invite>
            </
groups>
        </
sendfriend>
    </
sections>
</
config>
 
Magento Community Magento Community
Magento Community
Magento Community
 
ckosny
Guru
 
Total Posts:  349
Joined:  2009-02-28
Luxembourg
 

I have read here http://t.wits.sg/2009/03/31/howto-repackageable-custom-extension-development-in-magento-part-2-admin-controller/ that Magento uses this class for translating stuff and automatically invokes it. I am not sure whether this applies to your case, but maybe it would enough to simply create the class,apparently it does not need to have functionality.

Good luck

Claudia

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriel Queiroz
Sr. Member
 
Total Posts:  135
Joined:  2008-05-28
Brasília, Brazil
 

In case someone is still looking after this issue…

If you pay attention to the error message on the first post (Fatal error: Class ‘Mage_Invitefriend_Helper_Data’ not found in ...), you can see that the “Mage” namespace shouldn’t have been used there… It should have been Implementek_Invitefriend_Helper_Data instead, which uses the namespace used on that specific module. To tell magento that you have your own helpers for this module, you should add this lines to your config.xml, inside within the config->globals tags:

<helpers>
    <
invitefriend>
        <class>
Implementek_Invitefriend_Helper</class>
    </
invitefriend
</
helpers>

This way you are telling magento to look for the helpers called inside you module in the Helper folder inside your module. Of course, after this you should create your module’s helper. The path would be: app/code/local/Implementek/Invitefriend/Helper/Data.php, and the content would be:

<?php

class Implementek_Invitefriend_Helper_Data extends Mage_Core_Helper_Abstract
{
    
}

And of course, if you are not the guy who posted this thread, remember you have to replace the Company namespace and the module name as appropriate for your module.

Cheers,

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top