0

I created a new module which I will explain below. I can see the new options on the admin. I clicked on role, administrators and saved. I logged out and logged in

However I still see 404 Not found when I want to change the config. http://screencast.com/t/IbLJeVjpxMm

Config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Luisvalencia_Affiliate>
            <version>0.0.1</version>
        </Luisvalencia_Affiliate>
    </modules>
    <global>
        <models>
            <luisvalencia_affiliate>
                <class>Luisvalencia_Affiliate_Model</class>
            </luisvalencia_affiliate>
        </models>
        <helpers>
            <affiliate>
                <class>Luisvalencia_Affiliate_Helper</class>
            </affiliate>
        </helpers>
    </global>
    <frontend>
        <events>
            <controller_action_predispatch>
                <observers>
                    <luisvalencia_affiliate>
                        <class>luisvalencia_affiliate/observer</class>
                        <method>captureReferral</method>
                        <type>singleton</type>
                    </luisvalencia_affiliate>
                </observers>
            </controller_action_predispatch>
        </events>
    </frontend>
</config>

adminhtml.xml

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <luisvalenciasection translate="title" module="affiliate">
                                        <title>Luisvalencia Section</title>
                                        <sort_order>0</sort_order>
                                    </luisvalenciasection>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

system.xml

<?xml version="1.0" ?>
<config>
    <tabs>
        <luisvalenciatab translate="label" module="affiliate">
            <label>Luisvalencia Cookie</label>
            <sort_order>0</sort_order>
        </luisvalenciatab>
    </tabs>
    <sections>
        <luisvalenciasection  translate="label" module="affiliate">
            <label>Luisvalencia</label>
            <tab>luisvalenciatab</tab>
            <frontend_type>text</frontend_type>
            <sort_order>0</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <luisvalenciagroup translate="label">
                    <label>Luisvalencia Group</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>0</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <cookie_time translate="label">
                            <label>Set Cookie Time</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </cookie_time>
                    </fields>
                </luisvalenciagroup>
            </groups>
        </luisvalenciasection>
    </sections>
</config>

Data.php

<?php
class Luisvalencia_Affiliate_Helper_Data extends Mage_Core_Helper_Abstract {
}

Observer.php

<?php
class Luisvalencia_Affiliate_Model_Observer
{
    const COOKIE_KEY_SOURCE = 'luisvalencia_affiliate_source';

    public function captureReferral(Varien_Event_Observer $observer)
    {
        $cookietime = Mage::getStoreConfig('luisvalenciasection/luisvalenciagroup/cookie_time');
        if(Mage::getModel('core/cookie')->get('ref') != 'cj'){
            if( isset($_GET["ref"]) ){
                $ref=$_GET["ref"];
            }
            else{
                $ref='';
            }

            $name_c = 'ref';
            $val_c = $ref;
            $expired = 31556926; /* 1 year */
            $path = '/';

            $cookie = Mage::getSingleton('core/cookie');
            $cookie->set($name_c, $val_c ,(int)$cookietime,$path);
        }
    }
}

Luisvalencia_Affiliate.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Luisvalencia_Affiliate>
            <active>true</active>
            <codePool>community</codePool>
        </Luisvalencia_Affiliate>
    </modules>
</config>
3
  • I can see it in the admin, but when I click on the section it fails with 404 screencast.com/t/51fz2dUyLeC Commented Aug 14, 2014 at 19:24
  • cache has been cleared and still same problem Commented Aug 14, 2014 at 19:33
  • As i already tell goto admin and login with admin user name and password.... then to goto System>Permission>Role>Select Admin role and browse and click on save button...after that clear cache and logout from admin
    – Amit Bera
    Commented Aug 14, 2014 at 20:19

1 Answer 1

1

It's seem to be a permission issue in your adminhtml.xml, take a look at xml structure for admin configurations, you seem to missing the <all> and <acl>

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
           <all>
             <title>Allow Everything</title>
           </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <luisvalenciasection translate="title" module="affiliate">
                                        <title>Luisvalencia Section</title>
                                        <sort_order>0</sort_order>
                                    </luisvalenciasection>
                                </children>
                            </config>
                        </children>
                    </system>
                    <acl>
                        <children>
                            <luisvalenciasection translate="title" module="affiliate"> 
                                <title>Luisvalencia Section</title>
                            </luisvalenciasection>
                        </children>
                    </acl> 
2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.