QUOTE (catalepticstate @ May 29 2008, 02:52 PM)

Hi,
This contribution works ok.
When I installed it the errors that were given on the add product page where
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 552
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 558
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 591
Warning: reset() [function.reset]: Passed variable is not an array or object in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 597
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 599
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 608
Warning: reset() [function.reset]: Passed variable is not an array or object in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 614
Warning: Invalid argument supplied for foreach() in H:\sokkit\site\cartgrid\admin\includes\classes\grid.php on line 616
Errors :3 :Need to set unique row and col
Yes this bug was reported before. I thought I had fixed it in the version 1.3 that is uploaded on my server however I may have missed a couple of lines please get Version 1.4
here.
You will not find it in the contributions section of the forum until I know for sure from you guys whether this is fixing the problem. Remmeber, PHP5 is not giving me an error so I rely on you guys to let me know and help me to better help you.
Explanation: The errors being produced seem to be caused by the foreach() not finding an iterable array.
To fix it I have basically added a trap for first checking that an array exists in $_POST['edit']['price'] with the if (is_array($pricedit)){
statement.
Try that fix if you haven't already. If it still gives the foreach() errror, then back to the drawing board.
CODE
$pricedit=$_POST['edit']['price'];
if (is_array($pricedit)){
foreach( $pricedit as $gid=>$price){
if (!is_numeric($price)){$price_error="ENTER NUMERIC PRICE"; $err=true; $error['price'][]=$gid;}
else{$query="UPDATE products_grid SET grid_values_price ='".$price."' WHERE products_grid_id = ". (int)$gid." LIMIT 1";
mysql_query($query);
}}}
A few other places I added the test ''if (is_array(..))''