Author Topic: Class 'vmLanguage' not found  (Read 353 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 232
Class 'vmLanguage' not found
« 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:
Code: [Select]
<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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Class 'vmLanguage' not found
« Reply #1 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?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sandomatyas

  • Jr. Member
  • **
  • Posts: 232
Re: Class 'vmLanguage' not found
« Reply #2 on: October 31, 2018, 07:05:08 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8433
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Class 'vmLanguage' not found
« Reply #3 on: October 31, 2018, 11:17:26 am »
Quote
so 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation