VirtueMartCustomFieldRenderer overide in 3.0.12

Started by Studio 42, November 15, 2015, 10:18:01 AM

Previous topic - Next topic

Studio 42

Hi all,

I need to overide VirtueMartCustomFieldRenderer in a system plugin but currently the new code don't check for exising class in
JOOMLAROOT\administrator\components\com_virtuemart\models\customfields.php  line 780 and 805.

    if(self::$customfieldRenderer){
self::$customfieldRenderer = false;

if (!class_exists ('VmView'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'vmview.php');
$lPath = VmView::getVmSubLayoutPath ('customfield');

if($lPath){
require ($lPath);
} else {
vmdebug('displayProductCustomfieldFE layout not found customfield');
}
}


adding a class_exists with this code:

if(self::$customfieldRenderer){
self::$customfieldRenderer = false;
if(!class_exists('VirtueMartCustomFieldRenderer') {
if (!class_exists ('VmView'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'vmview.php');
$lPath = VmView::getVmSubLayoutPath ('customfield');

if($lPath){
require ($lPath);
} else {
vmdebug('displayProductCustomfieldFE layout not found customfield');
}
}
}


Solve the problem with a minimum code change.
Thanks to fix this.

Patrick