VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: simsar78 on February 05, 2012, 11:36:34 AM

Title: Error online 522 in this file: vmpsplugin.php
Post by: simsar78 on February 05, 2012, 11:36:34 AM
when i go to the cart i receveid this error in head of cart:

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.xxx.xx/home/administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 522

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.xxx.xx/home/administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 522

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.xxx.xx/home/administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 522

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.xxx.xx/home/administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 522

I use J1.5.25 and 1.7 whit virtuemart 2.0.1.d

Thanks

EDIT:  I have this problem only whit j 1.5.25
Title: Re: Error online 522 in this file: vmpsplugin.php
Post by: p.barg on February 06, 2012, 09:55:47 AM
Yes, I get the same warnings with j1.5x and VM 2.0.1.d
Title: Re: Error online 522 in this file: vmpsplugin.php
Post by: flo31 on February 06, 2012, 10:29:53 AM
Try replace in /administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 522

Replace :

foreach ($this->methods as $method) {
    VmTable::bindParameterable($method, $this->_xParams, $this->_varsToPushParam);
}



By :
if (count($this->methods) ! = 0 ) {
  foreach ($this->methods as $method) {
VmTable::bindParameterable($method, $this->_xParams, $this->_varsToPushParam);
}
}



Or if you configure a shipment and payment method I think the warning won't appear anymore.
Title: Re: Error online 522 in this file: vmpsplugin.php
Post by: p.barg on February 07, 2012, 08:27:18 AM
I do have shipment and payment methods defined...