Author Topic: "Undefined property" after 2.0.8e with no shipping address on record.  (Read 3248 times)

growfish

  • Beginner
  • *
  • Posts: 13
After upgrading to 2.0.8e,  get the following error on any cart pages like adding/editing shipping addresses, viewing past orders, etc.

Quote
Notice: 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!!!

ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #1 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:

Code: [Select]

} else{


which is within this condition statement

Code: [Select]

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

growfish

  • Beginner
  • *
  • Posts: 13
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #2 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

Code: [Select]
if ($this->show and $this->JUser->id == 0  ) {

of

Code: [Select]
// 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?

growfish

  • Beginner
  • *
  • Posts: 13
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #3 on: August 11, 2012, 02:51:33 am »
anyone?!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #4 on: August 12, 2012, 00:26:53 am »
Disable the template, which you bought to be sure.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

growfish

  • Beginner
  • *
  • Posts: 13
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #5 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?!?!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #6 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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28223
  • Always on vacation
    • Jenkin Hill Internet
Re: "Undefined property" after 2.0.8e with no shipping address on record.
« Reply #7 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.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14