DreadBv Posted October 5, 2015 Share Posted October 5, 2015 (edited) Hello, I have a big problem with the default Product Reviews module (v 3.5.1), even if I press Uninstall i get this error: I did set the ('_PS_MODE_DEV_', true) to see this error , otherwise it's just a blank page Notice: Trying to get property of non-object in /home/psboxro/public_html/classes/controller/FrontController.php on line 291Fatal error: Call to a member function isLogged() on a non-object in /home/psboxro/public_html/classes/controller/FrontController.php on line 464 From BO when I click "Product reviews" I get the same error. I manually deleted the module, and from BO when I click Install ... again with the error. Prestashop ver. 1.6.1.0 Edited October 5, 2015 by DreadBv (see edit history) Link to comment Share on other sites More sharing options...
gabdara Posted October 6, 2015 Share Posted October 6, 2015 Try to do an upgrade to PrestaShop v1.6.1.1 . I have the same version of the module and it's working fine. Link to comment Share on other sites More sharing options...
joseangel2003 Posted November 5, 2015 Share Posted November 5, 2015 Hi, i have same error, can help please? Thanks Link to comment Share on other sites More sharing options...
gabdara Posted November 6, 2015 Share Posted November 6, 2015 What version of PrestaShop and Product Reviews module are you using? From the error it looks like there is something weird with a customer. You might have some corrupted data to one or more customers. Have you deleted any accounts lately? Are there any comments from a customer that isn't available in your store anymore? Link to comment Share on other sites More sharing options...
joseangel2003 Posted November 7, 2015 Share Posted November 7, 2015 Hi gabdabara, i use version 1.6.1.1, this is error edit or uninstalling module "Notice: Trying to get property of non-object in /classes/controller/FrontController.php on line 291Fatal error: Call to a member function isLogged() on a non-object in /classes/controller/FrontController.php on line 457" yes we deleted many test accounts Best regards pd sory my english Link to comment Share on other sites More sharing options...
gabdara Posted November 9, 2015 Share Posted November 9, 2015 You should find all the tables in the database that use the customer id and remove all the rows of the customers that don't exist anymore. Link to comment Share on other sites More sharing options...
joseangel2003 Posted November 10, 2015 Share Posted November 10, 2015 Wow, there is no way to add code that does not exist if the customer does not take into account and ignore the error? It is a long job search board by board that id be eliminated! best regards Link to comment Share on other sites More sharing options...
gabdara Posted November 10, 2015 Share Posted November 10, 2015 Wow, there is no way to add code that does not exist if the customer does not take into account and ignore the error? Not sure if it will work, but you could try the following changes. https://github.com/PrestaShop/PrestaShop/blob/1.6.1.1/classes/controller/FrontController.php#L291 Change into: if (isset($_GET['logout']) || (Validate::isLoadedObject($this->context->customer) && $this->context->customer->logged && Customer::isBanned($this->context->customer->id))) { https://github.com/PrestaShop/PrestaShop/blob/1.6.1.1/classes/controller/FrontController.php#L295 Change into: } elseif (isset($_GET['mylogout']) && Validate::isLoadedObject($this->context->customer)) { https://github.com/PrestaShop/PrestaShop/blob/1.6.1.1/classes/controller/FrontController.php#L457 Change into: 'is_logged' => Validate::isLoadedObject($this->context->customer) && $this->context->customer->isLogged(), Link to comment Share on other sites More sharing options...
joseangel2003 Posted November 14, 2015 Share Posted November 14, 2015 Hi gabdara, I made the changes you recommended, now receive this message > Fatal error: Call to a member function isGuest() on a non-object in l/classes/controller/FrontController.php on line 458 best regards Link to comment Share on other sites More sharing options...
gabdara Posted December 7, 2015 Share Posted December 7, 2015 If you still have this problem you could try to adjust it in the same manner as the previous changes. https://github.com/PrestaShop/PrestaShop/blob/1.6.1.1/classes/controller/FrontController.php#L458 Change into: 'is_guest' => Validate::isLoadedObject($this->context->customer) && (bool)$this->context->customer->isGuest(), Basically, what all this changes do is before using a customer function it verifies if the customer really exists. If you can't find a way to eliminate junk customer data from database, then that validation should be placed everywhere you encounter a customer php error. Link to comment Share on other sites More sharing options...
andre.markus Posted February 4, 2016 Share Posted February 4, 2016 (edited) Hey joseangel2003, how did you solve the problem? If I modify the code gabdara mentioned, I run into hundreds of code pieces I have to change into "Validate::siLoadedObject..." That is not a good solution for updates. Thanks for a reply! EDIT: Found the problem by deactivating all overrides. So it must be an additional module installed, in my case "prettyurls". In the Dispatcher.php / Line 458 change: if (preg_match('/\?/', $this->request_uri) && preg_match('/productcomments/', $this->request_uri)) to: if (preg_match('/\?/', $this->request_uri) && preg_match('/productcomments/', $this->request_uri) && ($controller != 'AdminModules') ) Explanation: The Backoffice-URL to configure the module contains also the segment "productcomments" like in frontoffice. so prettyurl sets the $controller = "default" in the if-statement -> This breaks up Prestashop The developer of this module is informed. Cheers André Edited February 4, 2016 by andre.presta (see edit history) Link to comment Share on other sites More sharing options...
Anant Thakur Posted November 18, 2016 Share Posted November 18, 2016 (edited) I upgrade prestashop 1.6.0.1 t0 1.6.1.9 and I gotNotice: Trying to get property of non-object in /var/www/html/projects/nettesokken-upgraded/classes/controller/FrontController.php on line 291Fatal error: Call to a member function isLogged() on a non-object in /var/www/html/projects/nettesokken-upgraded/classes/controller/FrontController.php on line 457 But as I install fresh prestashop 1.6.1.9 on seperate folder it is working fine without error. I am using prestashop 1.6.1.9 and product comment version 3.5.2 Edited November 18, 2016 by Anant Thakur (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts