Author Topic: Bug when overriding models and controllers  (Read 1588 times)

Stephen Roberts

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 142
    • SundaySchool.com
Bug when overriding models and controllers
« on: November 10, 2011, 22:37:36 pm »
I built a system plugin to override a couple of models and controllers. In my plugin I had to include the following line:

Code: [Select]
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:

Code: [Select]
require(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'config.php');
to:

Code: [Select]
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10012
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Bug when overriding models and controllers
« Reply #1 on: November 11, 2011, 22:04:37 pm »
good point, added.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/