VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sandomatyas on October 30, 2018, 21:26:12 PM

Title: Class 'vmLanguage' not found
Post by: sandomatyas on October 30, 2018, 21:26:12 PM
I started to create a vmcustom plugin to run some scripts when an order goes to a specific order state.
This is the config block from the plugin's XML file:
<config>
<fields name="params">
<fieldset name="basic" addfieldpath="/administrator/components/com_virtuemart/fields">
<field name="orderstate1" type="vmorderstate" scope="com_virtuemart" default="S" label="orderstate1"  />
</fieldset>
</fields>
</config>


When I try to open the plugin's settings I get this error message:
Class 'vmLanguage' not found
.../administrator/components/com_virtuemart/fields/vmorderstate.php:33

The field is for selecting the order state when the scripts needs to be fired
Title: Re: Class 'vmLanguage' not found
Post by: GJC Web Design on October 30, 2018, 23:15:00 PM
maybe it needs a
VmConfig::loadConfig();

just b4 that line as your calling it outside of VM?
Title: Re: Class 'vmLanguage' not found
Post by: sandomatyas on October 31, 2018, 07:05:08 AM
Quote from: GJC Web Design on October 30, 2018, 23:15:00 PM
maybe it needs a
VmConfig::loadConfig();

just b4 that line as your calling it outside of VM?

Yep, I alredy found it if I put VmConfig::loadConfig(); into the code of JFormFieldVmOrderState it solves the problem. But I doesn't call it at all, this is an XML file, I can't put a PHP code in it, I just tried to use a vmorderstate type field for a vmcustom plugin, so I think Virtuemart's field class should load the config. Or am I missed something?
Title: Re: Class 'vmLanguage' not found
Post by: GJC Web Design on October 31, 2018, 11:17:26 AM
Quoteso I think Virtuemart's field class should load the config.

that's what I meant - it is /was probably assumed the fields class would only need to be used in  VM pages