I have set up in aMember admin CP that when a user logs in, it get redirected to one of page X in our website. I have also set up my website, so that when a new user signs up, it automatically logs into system after sign-up completion. However, before activating the account, this error appears on top of page X: Undefined index: user_id in /var/www/html/dev/amember/library/Am/Lite.php on line 613. (in getUserField($name) in the first if statement.) But after activation, no such error is shown. Can anybody tell me what the problem is and how I can solve it? Thanks.
Change your code which you use to get user_id. It should be: PHP: $user = Am_Lite::getInstance()->getUser();$user_id = $user['user_id']
I changed the code to Code: protected function getUserField($name) { if ($this->hasIdentity()) { $user = Am_Lite::getInstance()->getUser(); $user_id = $user['user_id']; return $user[$name]; } else { return null; } } Is this what you suggested? Because this did not remove the error.
That edit is not correct. I mean change your code which you use in order to get user_id. (and not code in Lite.php)