VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: easypony on August 03, 2016, 03:02:46 AM

Title: Fatal error: Cannot redeclare class vmVersion
Post by: easypony on August 03, 2016, 03:02:46 AM
Hi

Joomla version 3.6.0, PHP 5.5.30

I have updated to VM 3.0.14 and am getting a white screen on the front-end. After switching on error reporting I see the error:

Fatal error: Cannot redeclare class vmVersion in /home/XXXX/public_html/XXXX/administrator/components/com_virtuemart/version.php on line 22

I have searched for this error and cannot find an instance of it.

Please help.

Steve
Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: GJC Web Design on August 03, 2016, 10:10:36 AM
hmm .. haven't seen b4 but with J3.6.0 you must be using http://dev.virtuemart.net/attachments/download/1001/VirtueMart3.0.16_Joomla_3.5.1-Stable-Full_Package.zip

3.0.18 will be available soon
Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: easypony on August 03, 2016, 15:31:00 PM
Hi

Thanks for the reply.

I did install 3.0.16 and exactly the same error.

If I comment out the lines:

//if(!class_exists('vmVersion')) require(VMPATH_ADMIN.DS.'version.php');
//defined('VM_REV') or define('VM_REV',vmVersion::$REVISION);


From the administrator/components/com_virtuemart/helpers/config.php I get the site back but now with the error (only if error reporting is on so not a fatal error):

Notice: Use of undefined constant VM_REV - assumed 'VM_REV' in /home/XXXX/public_html/XXXX/administrator/components/com_virtuemart/helpers/vmjsapi.php on line 91

Notice: Use of undefined constant VM_REV - assumed 'VM_REV' in /home/XXXX/public_html/XXXX/administrator/components/com_virtuemart/helpers/vmjsapi.php on line 209


I hope that helps as I need to get this sorted.

Thanks
Steve
Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: GJC Web Design on August 03, 2016, 15:44:43 PM
As I say.. no other reports of this and the line

if(!class_exists('vmVersion')) require(VMPATH_ADMIN.DS.'version.php');

is there to prevent the

Fatal error: Cannot redeclare class vmVersion in /home/XXXX/public_html/XXXX/administrator/components/com_virtuemart/version.php on line 22

VM_REV needs to be declared of course

Can only suggest that vmVersion is being declared somewhere else by old files etc

what is the site history?

Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: PRO on August 03, 2016, 16:14:51 PM
what about the AIO component?

did you update it?
Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: easypony on August 04, 2016, 02:09:11 AM
Hi

Yes updated the AIO component.

Steve
Title: Re: Fatal error: Cannot redeclare class vmVersion
Post by: GJC Web Design on August 04, 2016, 13:47:46 PM
then u need to do a trace or enable Xdebug etc to find where it is already declared..

but as we already asked the history of the site....    :-\