I was just configuring some shipping options and testing them in the cart when I refreshed the page and hit this error:
Fatal error: Cannot access protected property TableProducts::$_pkey in /Users/stephenroberts/Sites/imd/administrator/components/com_virtuemart/models/product.php on line 393
I can't navigate the front-end at all now without hitting this error. This happened once before in a previous revision and I had to reinstall the whole store. Anyone else hit this yet and have any ideas?
Currently on Joomla! 1.5.24 with VM revision 4902.
Doing this let's me limp along at least, but I don't understand what changed and what's really causing this problem.
product.php line 392:
if(isset($child->$k) && empty($child->$k)){
A bit strange yes.
Please try instead of yours, this fix:
$parentProduct = $this->getProductSingle($child->product_parent_id,$front, false,false);
if($child->product_parent_id === $parentProduct->product_parent_id) break;
$attribs = get_object_vars($parentProduct);
foreach($attribs as $k=>$v){
if(strpos($k,'_')!==0 && empty($child->$k)){
$child->$k = $v;
vmdebug('getProduct $k',$k);
}
}
$i++;
That works also. I'll keep an eye out for anything else strange happening...
My version just creates/copy not the internal variables, which should be better anyway.
Agreed. I'm going to set up a fresh installation and compare it with my current one and see if I can figure out what happened and if there's possibly a deeper problem here.
It turns out that I'm calling getProduct(), the offending function, in a module and that seems to causing the problem. I think your solution does the trick so I'd say this case is closed. :)