JUser: :_load: Unable to load user with id [2.0 Stable Release]

Started by geraint, December 30, 2011, 12:45:42 PM

Previous topic - Next topic

geraint

Any component that uses &cid[]=nnn in a URL throws an error in VM2 modules.

To recreate the problem go to any webpage with a virtuemart module visible e.g. mod_virtuemart_product and then add &cid[]=999 or  ?cid[]=999 to the URL and you will see the error JUser: :_load: Unable to load user with id: 999

This is because the VmModel constructor calls // Get the id or array of ids.
$idArray = JRequest::getVar($this->_cidName,  0, '', 'array');
$this->setId((int)$idArray[0]);

This should ONLY happen on Virtuemart component pages.