News:

Looking for documentation? Take a look on our wiki

Main Menu

Class 'vmLanguage' not found

Started by sandomatyas, October 30, 2018, 21:26:12 PM

Previous topic - Next topic

sandomatyas

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

GJC Web Design

maybe it needs a
VmConfig::loadConfig();

just b4 that line as your calling it outside of VM?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sandomatyas

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation