Jump to content

Create Account Failed (1.6)


Recommended Posts

Hi... I'm new on Prestashop, I installed it on mu ubuntu latop, with apache,mysql and PHP 7. All works fine until I try to create a new account for customer and it fails when I click button "Registrer" with this error :

Fatal error: Uncaught Error: Access to undeclared static property: Validate::$data in /var/www/html/prestashop/classes/ObjectModel.php:1149 Stack trace: #0 /var/www/html/prestashop/controllers/front/AuthController.php(437): ObjectModelCore->validateController() #1 /var/www/html/prestashop/controllers/front/AuthController.php(256): AuthControllerCore->processSubmitAccount() #2 /var/www/html/prestashop/classes/controller/Controller.php(178): AuthControllerCore->postProcess() #3 /var/www/html/prestashop/classes/Dispatcher.php(367): ControllerCore->run() #4 /var/www/html/prestashop/index.php(28): DispatcherCore->dispatch() #5 {main} thrown in /var/www/html/prestashop/classes/ObjectModel.php on line 1149

The page is : "http://127.0.0.1/prestashop/login" form where I get Error.

I search on google for all day , but there isn't a solution.
Can you help me ?
Please
 

Link to comment
Share on other sites

Hi... I'm new on Prestashop, I installed it on mu ubuntu latop, with apache,mysql and PHP 7. All works fine until I try to create a new account for customer and it fails when I click button "Registrer" with this error :

Fatal error: Uncaught Error: Access to undeclared static property: Validate::$data in /var/www/html/prestashop/classes/ObjectModel.php:1149 Stack trace: #0 /var/www/html/prestashop/controllers/front/AuthController.php(437): ObjectModelCore->validateController() #1 /var/www/html/prestashop/controllers/front/AuthController.php(256): AuthControllerCore->processSubmitAccount() #2 /var/www/html/prestashop/classes/controller/Controller.php(178): AuthControllerCore->postProcess() #3 /var/www/html/prestashop/classes/Dispatcher.php(367): ControllerCore->run() #4 /var/www/html/prestashop/index.php(28): DispatcherCore->dispatch() #5 {main} thrown in /var/www/html/prestashop/classes/ObjectModel.php on line 1149

The page is : "http://127.0.0.1/prestashop/login" form where I get Error.

I search on google for all day , but there isn't a solution.

Can you help me ?

Please

 

what php version you've got on your local ubuntu lamp configuration?

seems like it's a case of php version.

Link to comment
Share on other sites

I have php 7. This is the response for "php --version" command:

 
php --version
PHP 7.0.1-5+deb.sury.org~wily+1 (cli) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

What's wrong?
Thank for the help.

Link to comment
Share on other sites

  • 11 months later...
  • 1 month later...

The support for Prestashop 1.5.4.1 on PHP7

 

File:

/classes/ObjectModel.php
 
Line number:
approx. 981
 
 
Original code part:
 
// Checking for fields validity
// Hack for postcode required for country which does not have postcodes
if (($value = Tools::getValue($field, $this->{$field})) || ($field == 'postcode' && $value == '0'))
{
if (isset($data['validate']) && !Validate::$data['validate']($value) && (!empty($value) || $data['required']))
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
else
{
if (isset($data['copy_post']) && !$data['copy_post'])
continue;
if ($field == 'passwd')
{
if ($value = Tools::getValue($field))
$this->{$field} = Tools::encrypt($value);
}
else
$this->{$field} = $value;
}
}
}
 
 
 
New code part:
 
// Checking for fields validity
// Hack for postcode required for country which does not have postcodes
if (($value = Tools::getValue($field, $this->{$field})) || ($field == 'postcode' && $value == '0'))
{
if (isset($data['validate']) && !call_user_func('Validate::'.$data['validate'],$value) && (!empty($value) || $data['required']))
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
else
{
if (isset($data['copy_post']) && !$data['copy_post'])
continue;
if ($field == 'passwd')
{
if ($value = Tools::getValue($field))
$this->{$field} = Tools::encrypt($value);
}
else
$this->{$field} = $value;
}
}
}
  • Thanks 1
Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...