2

I followed the tutorial on this page

http://www.johannreinke.com/en/2012/01/30/add-custom-settings-in-magento-admin-panel/

While I was able to get the source code provided to work without a problem, I have not been able to get the edited version of the code to work. It is telling me

Warning: include(Mage/VMR/Batch/Model/System/Config/Source/Dropdown/Values.php) [function.include]: failed to open stream: No such file or directory

Here is the XML Block defining that model

                    <multiple_dropdown translate="label comment">
                        <label>Multiselect</label>
                        <comment>Multiselect with global scope.</comment>
                        <frontend_type>multiselect</frontend_type>
                        <source_model>VMR_Batch/system_config_source_dropdown_values</source_model>
                        <sort_order>40</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>0</show_in_website>
                        <show_in_store>0</show_in_store>
                    </multiple_dropdown>

Any Ideas on why it is looking in Mage/VMR/.... Instead of VMR/.... ?

Edit: Here is my XML Block For Models

<global>
<models>
    <!-- VMR Batch Results Model Declaration -->
    <batch>
         <class>VMR_Batch_Model</class>
         <resourceModel>batch_mysql4</resourceModel>
    </batch>
    <!-- VMR Batch Results Table Declaration -->
    <batch_mysql4>
        <class>VMR_Batch_Model_Mysql4</class>
        <entities>
          <batch>
              <table>vmr_batches</table>
          </batch>
        </entities>
    </batch_mysql4>
</models>
2
  • 1
    Do you have a models section in your config.xml which defines the VMR_Batch alias? It would be best to add your config.xml here.
    – Simon
    Commented Mar 8, 2013 at 23:05
  • Is VMR Batch module loaded? Is it listed in Advanced section? If it is, does that module config.xml have models section which describes where to look for its models? And finally if it has that section, does it have 'VMR_Batch' for model alias? Commented Mar 8, 2013 at 23:06

1 Answer 1

2

Assuming the module is enabled and loading (if it's not, you'll need to solve that problem first), check the etc/config.xml in the VMR_Batch module and make sure it has the proper configuration declaring the class prefix for models:

<global>
    <models>
        <vmr_batch>
            <class>VMR_Batch_Model</class>
        </vmr_batch>
    </models>
</global>

Then where you are referencing the source model, reference it using all lower case to match the node name in the XML shown above:

vmr_batch/system_config_source_dropdown_values
4
  • Thank you for your response, I have edited my post and included my model definitions Commented Mar 9, 2013 at 15:24
  • Unfortunately, we have created quite a few modules already under the prefix VMR, which requires use to reference VMR with all caps, otherwise the error will say Mage/Vmr/Batch ... Commented Mar 9, 2013 at 16:36
  • To be clear, I'm not saying not to use VRM in all caps for your prefix. What I'm saying is the reference to the source model needs to be all lower case. You are declaring your model class prefix using the XML tag batch which means you need to reference the class as batch/system_config_source_dropdown_values. Magento will use this to create the final class name and file path with the uppercase VMR per the class prefix.
    – davidalger
    Commented Mar 10, 2013 at 3:32
  • The reason Magento is trying to load your class from Mage/VMR/Batch is because you do not have a class prefix defined for VMR_Batch in your config, only for batch. When there is no prefix defined it will always look in the Mage directory.
    – davidalger
    Commented Mar 10, 2013 at 3:34

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.