VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: growfish on August 01, 2012, 21:45:51 PM

Title: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: growfish on August 01, 2012, 21:45:51 PM
After upgrading to 2.0.8e,  get the following error on any cart pages like adding/editing shipping addresses, viewing past orders, etc.

QuoteNotice: Undefined property: VirtuemartViewUser::$JUser in /home/wwwlovin/public_html/dev/components/com_virtuemart/views/user/tmpl/login.php on line 28
Notice: Trying to get property of non-object in /home/wwwlovin/public_html/dev/components/com_virtuemart/views/user/tmpl/login.php on line 28

I happens if the user is logged in or not but happens for first time customers only. The message goes away when someone enters their shipping address in the Add/Edit address page. It does NOT show the message for returning customers (who have ordered before - because their address is recorded already).

You can view here: http://tinyurl.com/cgy6fvw

Please help! I am trying to launch my site!!!
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: ivus on August 02, 2012, 02:31:19 AM
Hi growfish,

Firstly are you using template overrides? If so your line number will be referencing something completely different to what the core code is... For example, I have an original install, untouched... and that line in my login.php file reads:



} else{



which is within this condition statement



if (empty($this->url)){
$uri = JFactory::getURI();
$url = $uri->toString(array('path', 'query', 'fragment'));
} else{
$url = $this->url;
}



...??? it makes no reference at all to $JUser

Also, you may want to check your javascript file (spritely.js) and remove/hash any lines that uses console.log() as it's writing crazy amount of lines in the console which makes debugging annoying.

I hope this helps.  ;D
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: growfish on August 10, 2012, 04:07:29 AM
Thanks for the reply.

To my knowledge I am NOT using any template overrides. It's a fresh install of VM on a template that I purchased.

But my line reads different then yours for some reason. My line 28 of login.php is


if ($this->show and $this->JUser->id == 0  ) {


of

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

if(!class_exists('shopFunctionsF')) require(JPATH_VM_SITE.DS.'helpers'.DS.'shopfunctionsf.php');
$comUserOption=shopfunctionsF::getComUserOption();
$uri = JFactory::getURI();
$url = $uri->toString(array('path', 'query', 'fragment'));
// vmdebug('$this->show ',$this);
if ($this->show and $this->JUser->id == 0  ) {
JHtml::_('behavior.formvalidation');
JHTML::_ ( 'behavior.modal' );
// vmdebug('cart',$this->cart);


All that is greek to me - but at least it does make mention of JUser.

Any ideas?
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: growfish on August 11, 2012, 02:51:33 AM
anyone?!
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: Milbo on August 12, 2012, 00:26:53 AM
Disable the template, which you bought to be sure.
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: growfish on August 12, 2012, 22:00:37 PM
I get the error even when my custom Joomla template is deactivated/disabled. Any ideas? I'm desperate here?!?!
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: Milbo on August 13, 2012, 12:05:48 PM
But then the error should show an other line, because the line you gave us is not the original one.
Title: Re: "Undefined property" after 2.0.8e with no shipping address on record.
Post by: jenkinhill on August 13, 2012, 18:50:22 PM
That code is in the version of login.php included in VM 2.0.2 but not in the 2.0.8e version. So either it is an incomplete update to 2.0.8e or there is an old override file being used.