News:

Support the VirtueMart project and become a member

Main Menu

Bug when overriding models and controllers

Started by Stephen Roberts, November 10, 2011, 22:37:36 PM

Previous topic - Next topic

Stephen Roberts

I built a system plugin to override a couple of models and controllers. In my plugin I had to include the following line:

if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');

When going to the VM admin panel, an error is thrown about not being able to redeclare a class. I tracked the problem down to /administrator/components/com_virtuemart/admin.virtuemart.php. Please change the following line:

require(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'config.php');

to:

if (!class_exists( 'VmConfig' )) require(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'config.php');

I hope to see this in the next update! Thanks!
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/