0

i have system.xml as follow:

                    <export translate="label">
                        <label>Export</label>
                        <frontend_model>velajne_adminhtml/system_config_form_field_exportjne</frontend_model>
                        <sort_order>80</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>0</show_in_store>
                    </export>

and config.xm as follows:

    <models>
        <velajne>
            <class>Vela_Jne_Model</class>
            <resourceModel>velajne_mysql4</resourceModel>
        </velajne>
        <velajne_adminhtml>
            <class>Vela_Jne_Model_Adminhtml</class>
        </velajne_adminhtml>
        <velajne_shipping>
            <class>Vela_Jne_Model</class>
            <resourceModel>velajne_mysql4</resourceModel>
        </velajne_shipping>

Why does it produce errors like this

Warning: include(Mage\Velajne\Adminhtml\Block\System\Config\Form\Field\Exportjne.php): failed to open stream: No such file or directory  in D:\WWW\Domains\magentodev.local\htdocs\lib\Varien\Autoload.php on line 93

It seems that it can't resolve velajne_adminhtml correctly. if i use just velajne or velajne_shipping it resolved correctly.

3
  • The file in the warning does not appear to match the file defined in the backend_model. Is this really the part causing the error? Sep 17, 2014 at 9:41
  • yep it is. it doesn't resolve backend_model correctly. it should resolve to Vela\Jne\Block\Adminhtml\System\Config\Form\Field\Exportjne.php Sep 17, 2014 at 9:46
  • i just found the answer, frontend_model resolve to Blocks (instead of Models) and i dont have this Blocks definition in my config.xml Sep 17, 2014 at 9:57

1 Answer 1

1

found the answer, frontend_model resolves to Blocks (instead of Models) and i didnt have this Blocks definition in my config.xml that's why it produced error.

Adding velajne_adminhtml to my config.xml -> global -> blocks fixed the problem

<global>
    <blocks>
        <velajne>
            <class>Vela_Jne_Block</class>
        </velajne>
        <velajne_adminhtml>
            <class>Vela_Jne_Block_Adminhtml</class>
        </velajne_adminhtml>
1
  • please mark this as accepted.
    – Marius
    Nov 9, 2014 at 14:32

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.