Erreur 404 introuvable lors de la création d'un groupe et de champs personnalisés dans la configuration du système

14

J'essaie de créer un groupe et certains champs pour ma section personnalisée sous l'onglet personnalisé

L'onglet et la section sont en cours de création, mais lorsque je clique sur la section dans la zone de contenu, une erreur 404 est introuvable

mon fichier system.xml est le suivant

<config>
    <tabs>
        <!--node is just an identifier-->
        <animala translate="label" module="training_animal">
            <label>Training</label>
            <sort_order>1</sort_order>
        </animala>
    </tabs>
    <sections>
        <animals translate="label" module="training_animal">
            <class>seperator-top</class>
            <label>Training</label>
            <!--node vlaue should match the tabs node name-->
            <tab>animala</tab>
            <frontend_type>text</frontend_type>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>

            <groups>
                <training_animal_group translate="label">
                    <label>My Custom Group</label>
                    <comment>Some comment about my group</comment>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <training_animal_field translate="label tooltip comment">
                            <label>My Custom Field</label>
                            <comment>Some comment about my field</comment>
                            <tooltip>Field ToolTip</tooltip>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <frontend_type>text</frontend_type>
                        </training_animal_field>
                    </fields>
                </training_animal_group>
            </groups>
        </animals>
    </sections>
</config>

L'URL de ma section est

http://localhost/mage2/index.php/admin/system_config/edit/section/animal/

module config.xml

<modules>
    <Training_Animal>
        <version>0.2.0</version>
    </Training_Animal>
</modules>

Training_Animal_Block

    <training_animal>
        <class>Training_Animal_Helper</class>
    </training_animal>

</helpers>

zamil
la source
Je tiens à remercier toutes les personnes impliquées dans ce fil de m'avoir énormément aidé :)
siliconrockstar

Réponses:

31

Vous devez également définir vos ressources ACL pour le groupe de configuration système personnalisé. Je suppose que vous utilisez Magento> 1.5. Dans votre adminhtml.xml( app/code/{codepool}/Training/Animal/etc/adminhtml.xml):

<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <animals translate="title" module="training_animal">
                                        <title>Animals</title>
                                        <sort_order>999</sort_order>
                                    </animals>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

Dans la version antérieure de Magento, ces informations étaient stockées dans le config.xml.

fmrng
la source
6
De plus, après avoir ajouté ce fichier, déconnectez-vous et reconnectez-vous pour laisser Magento actualiser les règles ACL.
fmrng
2
En fait, j'avais mis ma ressource acl. mais je ne me suis pas déconnecté ni connecté. Son fonctionne bien maintenant. Merci
zamil
Merci fmrng. Cela m'a aidé. Plus tôt, je manquais avec certaines des balises dans les ressources acl ...
Pavan Kumar