warning: Invalid argument supplied for foreach() in /uc_product.module on line 919

baalsgate - June 30, 2009 - 17:07
Project:Ubercart Manufacturers
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

when no items are set to the manufacturer there's a listing error , simple to fix ... i dunno ?

#1

baalsgate - June 30, 2009 - 17:23

ok its fixed i found a similar php issue that had this as a fix and well it actualy works so dont know how to add the modified file "uc_product.module"

here is the patch

line 919 is the case 'data' subroutine after the line saying

$data = array();

* Add this line
if(is_array($args['nids']))
{

then there the foreach and bit more code untill you see

return $data;

* add the close bracket here
}

well all it does is checks to see if there is any value before the foreach statement and if theres not it skips the routeen and avoids the error , not glamorous but it works, now someone smarter than me can add this to a new version so i dont add the bug back in , when I upgrade again ... thankyou !

 
 

Drupal is a registered trademark of Dries Buytaert.