Page 1 of 2
PHP Notice: Undefined index in account/register
Posted: Wed Apr 25, 2012 5:21 pm
by Aladdin
Hello,
I am using version 1.5.2.1 with default template, and I keep getting these errors every time I change to different language from account/register page:
PHP Notice: Undefined index: firstname in catalog/controller/account/register.php on line 282
PHP Notice: Undefined index: lastname in catalog/controller/account/register.php on line 286
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 290
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 290
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 294
PHP Notice: Undefined index: telephone in catalog/controller/account/register.php on line 298
PHP Notice: Undefined index: address_1 in catalog/controller/account/register.php on line 302
PHP Notice: Undefined index: city in catalog/controller/account/register.php on line 306
PHP Notice: Undefined index: country_id in catalog/controller/account/register.php on line 312
PHP Notice: Undefined index: postcode in catalog/controller/account/register.php on line 314
PHP Notice: Undefined index: country_id in catalog/controller/account/register.php on line 318
PHP Notice: Undefined index: zone_id in catalog/controller/account/register.php on line 322
PHP Notice: Undefined index: password in catalog/controller/account/register.php on line 326
PHP Notice: Undefined index: confirm in catalog/controller/account/register.php on line 330
PHP Notice: Undefined index: password in catalog/controller/account/register.php on line 330
Please note that you dont see these errors if you visit the page first time from the default language, they are only shown up when you change to other language from account/register page (create account page).
Any idea?
Regards
Aladdin
Re: PHP Notice: Undefined index in account/register
Posted: Wed Apr 25, 2012 5:51 pm
by Avvici
You are getting errors from the following function :
Code: Select all
private function validate() {
if ((utf8_strlen($this->request->post['firstname']) < 1) || (utf8_strlen($this->request->post['firstname']) > 32)) {
$this->error['firstname'] = $this->language->get('error_firstname');
}
Your custom template either does not have the correct variable name in the .tpl, OR, the language file is missing some variables. You should check both.
Template: catalog/view/theme/your_theme/template/account/register.tpl
Make sure you see
Code: Select all
<input type="text" name="firstname" value="<?php echo $firstname; ?>" />
And in your language file:
catalog/language/your_language/account/register.php
Make sure you see:
Code: Select all
$_['error_firstname'] = 'First Name must be between 1 and 32 characters!';
Use this test for all of your errors:)
Re: PHP Notice: Undefined index in account/register
Posted: Wed Apr 25, 2012 9:13 pm
by Aladdin
Thanks for your reply, however both files (tpl and languages files) definitely include all variables with their correct values . I've just double checked them.
The errors are also shown in affiliate/register page (same thing, when you change the language on this page)
It must be something else ?
Regards
Aladdin
Re: PHP Notice: Undefined index in account/register
Posted: Fri May 11, 2012 4:01 am
by cs378
I have the same error shown.
I can't seem to figure out where the problem is occurring.
If anyone figures it out, please post the solution here.
Thank you
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 9:58 am
by straightlight
Try this.
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 10:39 am
by Aladdin
Thanks Straightlight, but the problem still there.
Please note that errors shows up only when you change language in any form page (such as account/register page):
Again, the errors are:
PHP Notice: Undefined index: firstname in catalog/controller/account/register.php on line 282
PHP Notice: Undefined index: lastname in catalog/controller/account/register.php on line 286
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 290
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 290
PHP Notice: Undefined index: email in catalog/controller/account/register.php on line 294
PHP Notice: Undefined index: telephone in catalog/controller/account/register.php on line 298
PHP Notice: Undefined index: address_1 in catalog/controller/account/register.php on line 302
PHP Notice: Undefined index: city in catalog/controller/account/register.php on line 306
PHP Notice: Undefined index: country_id in catalog/controller/account/register.php on line 312
PHP Notice: Undefined index: postcode in catalog/controller/account/register.php on line 314
PHP Notice: Undefined index: country_id in catalog/controller/account/register.php on line 318
PHP Notice: Undefined index: zone_id in catalog/controller/account/register.php on line 322
PHP Notice: Undefined index: password in catalog/controller/account/register.php on line 326
PHP Notice: Undefined index: confirm in catalog/controller/account/register.php on line 330
PHP Notice: Undefined index: password in catalog/controller/account/register.php on line 330
Regards
A.T
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:01 am
by straightlight
If you switch from English to any other languages you have and switch back to English, do you still see these error messages ?
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:05 am
by Aladdin
Yes, I do, every single click you change language back and forward , the errors show up in error log file.
Regards
A.t
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:11 am
by straightlight
From your database, in the address table, do you see the firstname, lastname fields as well as the email field from the customers table ?
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:19 am
by Aladdin
Yes, I do, if not i wont be able to store form data into DB . Nothing wrong with data storage,
Regards
Aladdin
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:24 am
by straightlight
Then this issue is obviously about posted variables from the form not being sessionized which these values during the previous event may be lost when switching languages. For instance, if you remain on the first language without switching, I presume you don't encounter any problems but only when you switch to another language, this problem occurs.
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:32 am
by Aladdin
True , any solution for this?
Regards
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:43 am
by Avvici
I installed a fresh 1.5.2.1 to try and replicate your error....no success. Works fine for me with 2-3 different languages changing on registration page. Did you upgrade to 1.5.2.1?
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 11:50 am
by straightlight
During while, I have updated my XML file above.
Re: PHP Notice: Undefined index in account/register
Posted: Sat May 12, 2012 9:10 pm
by Daniel
this is a spam bot going around trying to post spam to forms. just ignore it.
Re: PHP Notice: Undefined index in account/register
Posted: Tue May 15, 2012 7:09 pm
by big2142
same error to me in account/register
Re: PHP Notice: Undefined index in account/register
Posted: Tue May 15, 2012 8:31 pm
by straightlight
Have you tried the XML file ?
Re: PHP Notice: Undefined index in account/register
Posted: Tue May 15, 2012 8:36 pm
by big2142
straightlight wrote:Have you tried the XML file ?
yes, the error desapeared, but the account was not created.
Re: PHP Notice: Undefined index in account/register
Posted: Tue May 15, 2012 8:40 pm
by big2142
More data, when you create the account from the payment form, there is no problem, the account appears etc, when you uses the index.php?route=account/register, is when the hells appears.
Re: PHP Notice: Undefined index in account/register
Posted: Fri Apr 12, 2013 4:43 pm
by byens
you should check your account/register.tpl file from custom theme and see what the different from original files.
For me changing
Code: Select all
$('#payment-address select[name=\'customer_group_id\']:checked').trigger('change');
into
Code: Select all
$('#payment-address input[name=\'customer_group_id\']:checked').trigger('change');
and no more php notice error