VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: bboom on December 10, 2014, 19:39:31 PM

Title: Warning: implode(): Invalid arguments
Post by: bboom on December 10, 2014, 19:39:31 PM
Hi,

I found an error in the VirtueMart product model. when I use the function loadProductPrices (in the product model), PHP gives me the following error:

Warning: implode(): Invalid arguments passed in /home/***/administrator/components/com_virtuemart/models/product.php on line 938

The code on that line is:

static $loadedProductPrices = array();
$hash = $productId.','.implode($virtuemart_shoppergroup_ids,'.').','.(int)$front; //md5($q);


I think this is not the correct usage of the implode function. the function requires an array as seccond param.
Title: Re: Warning: implode(): Invalid arguments
Post by: Jörgen on December 10, 2014, 20:58:17 PM
Hi

You can actually reverse the parameters for implode(). But for consistency the second parameter should be the array. Both usages are anyway allowed.

regards

Jörgen @ Kreativ Fotografi

Title: Re: Warning: implode(): Invalid arguments
Post by: Milbo on December 11, 2014, 14:03:16 PM
Thank you, params switched now. and directly found some more.