VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: RitchieTheBrit on February 17, 2008, 15:12:50 PM

Title: [FIXED] Bug Report - Empty Product Price...
Post by: RitchieTheBrit on February 17, 2008, 15:12:50 PM
Description: An empty entry in the Product Price field causes the following error on the category view:

Warning: Cannot use a scalar value as an array in C:\wamp\www\dvine\administrator\components\com_virtuemart\classes\ps_product.php on line 1759

The category displays fine after this error.

VirtueMart Version: VirtueMart 1.1 revision 1263

Joomla/Mambo Version: Joomla! 1.0.14 RC1 Stable [ Daybreak ] 13 January 2008 22:00 UTC

Steps to replicate: It happens if I simply edit a shop item and remove both product price entries (gross and net).  Replacing the price clears the error.

Proposed fix(es):  Sorry, I'm not a good enough coder to go poking around!

Bugtracker task #: 1810

System info:  Windows XP Professional Service Pack 2 (Windows NT 5.1 build 2600), Apache v2.2.6 (Win32), PHP v5.2.5 and MySQL v5.0.45-community-nt.

[attachment cleanup by admin]
Title: Re: [TRACKER 1810] Bug Report - Empty Product Price...
Post by: aravot on February 19, 2008, 20:04:06 PM
Tracker URL -> http://dev.virtuemart.net/cb/issue/1810
Title: Re: [TRACKER 1810] Bug Report - Empty Product Price...
Post by: vangoga on February 26, 2008, 22:05:22 PM
Quick fix:
insert following:

              if(!is_array($price)) $price=array();

before line 1759 in ps_product.php
         $price["product_price"] = $base_price + $adjustment;
Title: Re: [TRACKER 1810] Bug Report - Empty Product Price...
Post by: DH on March 24, 2008, 07:38:08 AM
I am meeting the same problem on
Joomla1.51
VM1.1.0  BETA3
I believe this is a VM bug,but I do not know where is the problem. Can "vangoga" or other kind people show me more details of how to quick fix.

Much thanks!
Title: Re: [TRACKER 1810] Bug Report - Empty Product Price...
Post by: jenkinhill on March 24, 2008, 12:54:16 PM
This bug was fixed. Beta3 is quite old now - try installing the latest RC2 nightly - http://dev.virtuemart.net/cb/proj/doc.do?doc_id=1328