VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: sprachrohr on January 15, 2019, 13:55:46 PM

Title: Require Orders Model failed
Post by: sprachrohr on January 15, 2019, 13:55:46 PM
Hello,

after Updating to VM 3.4.2 i have a problem. Joomla version is 3.9.1.

I have an Backend QuickIcon Plugin, where i require the VM Orders Model.
I used this code:
if (!class_exists('VirtueMartModelOrders')) {
   require(VMPATH_ADMIN . DS . 'models' . DS . 'orders.php');
}

After Update to VM 3.4.2 this code doesnt work anymore. I get a blank page without errors. Even if i fill in the whole path, i get a blank page.

Any suggestions?

Thank you!!!

Best regards
Dirk
Title: Re: Require Orders Model failed
Post by: GJC Web Design on January 15, 2019, 15:26:21 PM
maybe try
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();

before it
Title: Re: Require Orders Model failed
Post by: sprachrohr on January 15, 2019, 15:58:47 PM
thats it!!! Thanks a lot!!!

Could you explain why this is needed?
Title: Re: Require Orders Model failed
Post by: GJC Web Design on January 15, 2019, 23:13:34 PM
it ensures that the VM config is available and loaded