Matt Posted October 5, 2018 Share Posted October 5, 2018 Hi! I have a problem about, to move the hook "Login in the top of nav1" that had moved to nav2 back to nav1, cuz i made a misstake and moved it to wrong place to the "header something in the backoffice. I get "The server returned a "500 Internal Server Error" in the backoffice, and in every page that are in backoffice. Are there any solutions to move it to nav1 without do it in backoffice, maybe in som php file or tpl? or am i screwed. Best Regards Matt Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 11 minutes ago, Matt said: Hi! I have a problem about, to move the hook "Login in the top of nav1" that had moved to nav2 back to nav1, cuz i made a misstake and moved it to wrong place to the "header something in the backoffice. I get "The server returned a "500 Internal Server Error" in the backoffice, and in every page that are in backoffice. Are there any solutions to move it to nav1 without do it in backoffice, maybe in som php file or tpl? or am i screwed. Best Regards Matt Hi Matt, enable errors. Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 Ok i get this message: Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 And the logs looks lite this Level Channel Message CRITICAL10:37:18 php Call to a member function isLogged() on null DEBUG10:37:18 doctrine SELECT name FROM psf_module WHERE active = 1 CRITICAL10:37:18 request Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function isLogged() on null" at /customers/2/e/f/ftg.se/httpd.www/foretaget/modules/ps_customersignin/ps_customersignin.php line 55 Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 It's weird, as if it is trying to execute module from backoffice. Try to disable module and then move hook. Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 How to do that whithout any pages in backoffice? Link to comment Share on other sites More sharing options...
Knowband Plugins Posted October 5, 2018 Share Posted October 5, 2018 Hi, Do you have any idea of the phpMyAdmin (accessing DB table)? Entry can be deleted from the table to fix the issue but its a little bit tricky. I believe you have added the login block in "displayAdminNavBarBeforeEnd" hook. In the ps_hook DB table search for the displayAdminNavBarBeforeEnd. It will give you the hook id. You will get ID like 174. Now search 174 (In your case it may be different) in ps_hook_module table in id_hook column. In my case, there is one result but I believe there will be 2 entries in your case. You need to delete one entry (Most probably 2nd one). Kindly ensure to take the backup of the DB before deleting the same. Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 Ok Matt, I have reread your message again because I thought it only happened when you tried to move the module I would modify file modules/ps_customersignin/ps_customersignin.php, line 55 //$logged = $this->context->customer->isLogged(); $logged = false; Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 Thanks joseantgv! But it does not seem to work, same error! Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 Thanks Knowband Plugins! It was just one entries not 2 unfortunately. I did what you tell me. And there was only one entries Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 45 minutes ago, Matt said: Thanks joseantgv! But it does not seem to work, same error! So instead of my code, set a "return false;" at the beginning of the function. Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 29 minutes ago, Matt said: Thanks Knowband Plugins! It was just one entries not 2 unfortunately. I did what you tell me. And there was only one entries You can also fix it by database. If module ID 51 is ps_customersignin (check ID it at ps_module table) then change id_hook to nav1 (check ID at table ps_hook). Link to comment Share on other sites More sharing options...
joseantgv Posted October 5, 2018 Share Posted October 5, 2018 I have reproduced error and fixed it this way: public function getWidgetVariables($hookName, array $configuration) { if (!isset($this->context->customer)) { return false; } $logged = $this->context->customer->isLogged(); if ($logged) { $customerName = $this->getTranslator()->trans( '%firstname% %lastname%', array( '%firstname%' => $this->context->customer->firstname, '%lastname%' => $this->context->customer->lastname, ), 'Modules.Customersignin.Admin' ); } else { $customerName = ''; } $link = $this->context->link; return array( 'logged' => $logged, 'customerName' => $customerName, 'logout_url' => $link->getPageLink('index', true, null, 'mylogout'), 'my_account_url' => $link->getPageLink('my-account', true), ); } (note the if at the beginning) 1 Link to comment Share on other sites More sharing options...
Matt Posted October 5, 2018 Author Share Posted October 5, 2018 Thank you joseantgv very much, you´re Gold. It was the "return false;" that helped me. i haven´t tryied the other suggestions above yet, but can i re-hook the ps_customersignin to the nav1 again from the backoffice or is it better to make changes like you shown me in the topic above? "Solved" 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