VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: effengia on December 03, 2014, 19:14:26 PM

Title: Problem in VM3 updatesmigration.php
Post by: effengia on December 03, 2014, 19:14:26 PM
Hi,

The source code of administrator\components\com_virtuemart\controllers\updatesmigration.php contains the function installComplete, which has the following lines inside:

         if (!class_exists( 'ConfigModelApplication' )) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_config'.DS.'models'.DS.'application.php');
         $jConfModel = new ConfigModelApplication();

This piece of code works fine with Joomla 2.5, but crashes with the following fatal error being executed in Joomla 3 environment: "Class 'ConfigModelForm' not found in \administrator\components\com_config\model\application.php on line 20"

The reason is in the changes made inside administrator\components\com_config\model\application.php in Joomla 3 comparing to Joomla 2.5. Now the ConfigModelApplication class is inherited from the ConfigModelForm class described in components\com_config\model\form.php.

Best regards,
Effengia Team
http://effengia.com (http://effengia.com)
Title: Re: Problem in VM3 updatesmigration.php
Post by: Milbo on December 04, 2014, 09:01:39 AM
You may try somethign like


if(JVM_VERSION>2){
if (!class_exists( 'ConfigModelCms' )) require(VMPATH_ROOT.DS.'components'.DS.'com_config'.DS.'model'.DS.'cms.php');
if (!class_exists( 'ConfigModelForm' )) require(VMPATH_ROOT.DS.'components'.DS.'com_config'.DS.'model'.DS.'application.php');
if (!class_exists( 'ConfigModelApplication' )) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_config'.DS.'model'.DS.'application.php');
} else {
if (!class_exists( 'ConfigModelApplication' )) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_config'.DS.'models'.DS.'application.php');
}
Title: Re: Problem in VM3 updatesmigration.php
Post by: effengia on December 04, 2014, 10:59:16 AM
Yes, this is right the way of how it should be fixed before the full installer for Joomla 3 with VM3 is released.