Greetings!
Description:
When calling the cart module, the function prepareAjaxData() within components/com_virtuemart/helpers/cart.php pops up a warning message, shown in error log too:
[error] [client 127.0.0.1] PHP Warning: Creating default object from empty value in /xxxx/joomla/components/com_virtuemart/helpers/cart.php on line 1403, referer: http://loytec.com/en/myloytec/products-documents
This behavior is found in components/com_virtuemart/helpers/cart.php line 1397 ff (latest commit, 6 days ago)
//of course, some may argue that the $this->data->products should be generated in the view.html.php, but
//
$this->data->products = array();
$this->data->totalProduct = 0;
$i=0;
My suggestion: adding the following line to create an empty object,
this makes sense:
//of course, some may argue that the $this->data->products should be generated in the view.html.php, but
//
$this->data = new stdClass();
$this->data->products = array();
$this->data->totalProduct = 0;
$i=0;
regards,
Thomas Kuschel
http://loytec.com
I added this
if(empty($this->data)){
$this->data = new stdClass();
}
Hi Milbo,
in that case, it isn't really necessary to query the emptiness of $this->data .
It has nothing to do with robustness nor security. The class do _not_ exists.
All the best
Thomas
Imho it can be manipulated by plugins.