Gomlers Posted November 8, 2016 Share Posted November 8, 2016 (edited) Suddenly, there is not possible to create account. Errormessage when set PS_MODE_DEV to true is: Fatal error: Uncaught Error: Access to undeclared static property: Validate::$data in /home/account/public_html/classes/ObjectModel.php:1113 Stack trace: #0 /home/account/public_html/controllers/front/AuthController.php(414): ObjectModelCore->validateController() #1 /home/account/public_html/controllers/front/AuthController.php(243): AuthControllerCore->processSubmitAccount() #2 /home/account/public_html/classes/controller/Controller.php(171): AuthControllerCore->postProcess() #3 /home/account/public_html/classes/Dispatcher.php(373): ControllerCore->run() #4 /home/account/public_html/index.php(28): DispatcherCore->dispatch() #5 {main} thrown in /home/account/public_html/classes/ObjectModel.php on line 1113 Anyone? EDIT: FOUND THE ERROR! It was my host that updated to PHP 7. I downgraded it via cpanel to PHP version 5.5, and everything is running smoothly again. Edited November 10, 2016 by Gomlers (see edit history) 1 Link to comment Share on other sites More sharing options...
El Patron Posted November 8, 2016 Share Posted November 8, 2016 yea! I saw this and thought php 7..good debug and fix. Link to comment Share on other sites More sharing options...
w3bsolutions Posted November 10, 2016 Share Posted November 10, 2016 Do you mind marking the topic as solved to help others who might face the same issue easier? (Edit first post and add [sOLVED] at the beginning of title). Thanks! Link to comment Share on other sites More sharing options...
zod Posted February 1, 2018 Share Posted February 1, 2018 Another solution is keeping PHP7 and modify the class ObjectModel.php as described in this page: https://stackoverflow.com/questions/35406163/presta-shop-errors-on-registration 1 1 Link to comment Share on other sites More sharing options...
Gomlers Posted February 1, 2018 Author Share Posted February 1, 2018 But is the registration the only issue with php 7? php 7 is faster, indeed... Link to comment Share on other sites More sharing options...
zod Posted February 7, 2018 Share Posted February 7, 2018 The major problem is about the registration, and it is solved as described in the post i linked. To make it clear, it is editing classes/ObjectModel.php Replace !Validate::$data['validate']($value) with !call_user_func('Validate::'.$data['validate'],$value) But there are some other little problems that i fixed. Take note... 1) If you see some errors in the server log, about Deprecated, and Warning messages, about PEAR. Edit the file: prestashop/tools/pear/PEAR.php Replace function PEAR($error_class = null) with function __construct($error_class = null) Then also replace function PEAR_Error($message = 'unknown error', $code = null, with function __construct($message = 'unknown error', $code = null, 2) There could be some problems with SMARTY variables not defined in templates (.tpl) of theme or modules, you have a broken page and a server log with Fatal Error. You solve in many ways, it depends on the template you are fixing. You could try the following: A. If you know the default value that the variable should have, then define it before it is called, at the beginning of the template, like this (ex.: i give 3 elements per line as default): {if empty($nbItemsPerLine)} {assign var="nbItemsPerLine" value="3"} {/if} B. If you can't know the default value, try adding a conditional statement like this where the variable is called: {if isset($label)} ... do the things with $label... {/if} C. If the variable is never used, so it was forgotten during development, then delete it straight forward. 3) There is another weird error, but it was affecting a PS 1.5, the products list (in admin), was broken. The log is: "Fatal error: Unsupported operand types in controllers/admin/AdminProductsController.php on line 859" To fix this you need to remove the "+" signs at the beginning of two rows hinted by the log (imo it was a mistake of copy/paste from Github). + Array(), + Tools::getValue('available_date_attribute') 1 2 Link to comment Share on other sites More sharing options...
zod Posted February 9, 2018 Share Posted February 9, 2018 New errors discovered, same logic on validation problem, This time the Fatal Error is in BO, edit the file in classes/controller/AdminController.php Search the function processUpdateOptions at about row 1383 replace if (!Validate::$values['validation'](Tools::getValue($field.'_'.$language['id_lang']))) { with if (!call_user_func('Validate::'.$values['validation'],Tools::getValue($field.'_'.$language['id_lang']))) { Then, same function, few rows below, at about row 1391 replace if (!Validate::$values['validation'](Tools::getValue($field))) { with if (!call_user_func('Validate::'.$values['validation'],Tools::getValue($field))) { Search the function validateField at about row 3628 replace if (!Validate::$field['validation']($value)) { with if (!call_user_func('Validate::'.$field['validation'],$value)) { 1 Link to comment Share on other sites More sharing options...
idea99 Posted August 26 Share Posted August 26 Good morning I did this: !Validate::$data['validate']($value) with !call_user_func('Validate::'.$data['validate'],$value) But now all new users are registered WITHOUT validated by me. How to solve? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now