Jozikas Posted June 19, 2019 Share Posted June 19, 2019 Hello, I am trying to use jxheadermodule with facebook app log in. I configured the facebook app and OAuth, but after first redirect it gets http error 500 https://mydomain/module/jxheaderaccount/facebooklink?code=... What could I do and what causes the problem? ContextErrorException Notice: Undefined index: tpl_dir in a5b822f9ac176439d84fb2eac4af4d17f8642a6c_2.module.jxheaderaccountviewstempl.php line 28 at content_5d0a9a29ece766_26163384(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216 at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, 'layouts/layout-full-width.tpl', null, 0)in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch('module:jxheaderaccount/views/templates/front/facebooklink.tpl', null, 'layouts/layout-full-width.tpl', null,false, true, false)in SmartyDev.php line 40 at SmartyDev->fetch('module:jxheaderaccount/views/templates/front/facebooklink.tpl', null, 'layouts/layout-full-width.tpl')in FrontController.php line 682 at FrontControllerCore->smartyOutputContent('module:jxheaderaccount/views/templates/front/facebooklink.tpl')in FrontController.php line 666 at FrontControllerCore->display()in Controller.php line 301 at ControllerCore->run()in Dispatcher.php line 511 at DispatcherCore->dispatch()in index.php line 28 Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 19, 2019 Share Posted June 19, 2019 You should disable smarty cache and clear cache to get more readable paths, but it seems you are using a module written for PrestaShop 1.6 in 1.7. Link to comment Share on other sites More sharing options...
Jozikas Posted June 19, 2019 Author Share Posted June 19, 2019 Just now, Rodrigo B Laurindo said: You should disable smarty cache and clear cache to get more readable paths, but it seems you are using a module written for PrestaShop 1.6 in 1.7. This module was created for PS 1.7.X as i know. Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 19, 2019 Share Posted June 19, 2019 Could you disable the smarty cache and clear cache in "Advanced parameters > Performance" and paste here the errors again? Link to comment Share on other sites More sharing options...
Jozikas Posted June 19, 2019 Author Share Posted June 19, 2019 2 minutes ago, Rodrigo B Laurindo said: Could you disable the smarty cache and clear cache in "Advanced parameters > Performance" and paste here the errors again? It was already disabled. And after cache clear I get the same errors: in a5b822f9ac176439d84fb2eac4af4d17f8642a6c_2.module.jxheaderaccountviewstempl.php line 28 at content_5d0a9a29ece766_26163384(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216 at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, 'layouts/layout-full-width.tpl', null, 0)in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch('module:jxheaderaccount/views/templates/front/facebooklink.tpl', null, 'layouts/layout-full-width.tpl', null,false, true, false)in SmartyDev.php line 40 at SmartyDev->fetch('module:jxheaderaccount/views/templates/front/facebooklink.tpl', null, 'layouts/layout-full-width.tpl')in FrontController.php line 682 at FrontControllerCore->smartyOutputContent('module:jxheaderaccount/views/templates/front/facebooklink.tpl')in FrontController.php line 666 at FrontControllerCore->display()in Controller.php line 301 at ControllerCore->run()in Dispatcher.php line 511 at DispatcherCore->dispatch()in index.php line 28 Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 19, 2019 Share Posted June 19, 2019 What is disabled is smarty cache (top of the page) or caching (page bottom)? Can you configure smarty this way and tell if something has changed? Link to comment Share on other sites More sharing options...
Jozikas Posted June 19, 2019 Author Share Posted June 19, 2019 4 minutes ago, Rodrigo B Laurindo said: What is disabled is smarty cache (top of the page) or caching (page bottom)? Can you configure smarty this way and tell if something has changed? They are both disabled (smarty and simple caching, which is the last one on the page). I did try this configuration and got the same errors. Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 19, 2019 Share Posted June 19, 2019 Well, you will have to find the const tpl_dir in your module files and remove It. It is not used in Prestashop since 1.7.4 Link to comment Share on other sites More sharing options...
Jozikas Posted June 19, 2019 Author Share Posted June 19, 2019 Just now, Rodrigo B Laurindo said: Well, you will have to find the const tpl_dir in your module files and remove It. It is not used in Prestashop since 1.7.4 Ohh. The error did change: [PrestaShopException] Error: Authentication failed.at line 1109 in file classes/Tools.php 1104. ->getTranslator() 1105. ->trans('Fatal error', [], 'Admin.Notifications.Error'); 1106. } 1107. 1108. if (_PS_MODE_DEV_) { 1109. throw new PrestaShopException($errorMessage); 1110. } 1111. 1112. return $errorMessage; 1113. } 1114. ToolsCore::displayError - [line 67 - modules/jxheaderaccount/controllers/front/facebooklink.php] - [1 Arguments] JxHeaderAccountFacebookLinkModuleFrontController->initContent - [line 281 - classes/controller/Controller.php] ControllerCore->run - [line 511 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 19, 2019 Share Posted June 19, 2019 What do you have in /jxheaderaccount/controllers/front/facebooklink.php Line 67? Link to comment Share on other sites More sharing options...
Jozikas Posted June 20, 2019 Author Share Posted June 20, 2019 (edited) 9 hours ago, Rodrigo B Laurindo said: What do you have in /jxheaderaccount/controllers/front/facebooklink.php Line 67? Error: Authentication failed.at line 1109 in file classes/Tools.php 1104. ->getTranslator() 1105. ->trans('Fatal error', [], 'Admin.Notifications.Error'); 1106. } 1107. 1108. if (_PS_MODE_DEV_) { 1109. throw new PrestaShopException($errorMessage); 1110. } 1111. 1112. return $errorMessage; 1113. } 1114. ToolsCore::displayError - [line 67 - modules/jxheaderaccount/controllers/front/facebooklink.php] - [1 Arguments] 62. 63. try { 64. $session = $helper->getSessionFromRedirect(); 65. } catch (FacebookRequestException $ex) { 66. // When Facebook returns an error 67. $this->errors[] = Tools::displayError('Error: Authentication failed.'); 68. } catch (Exception $ex) { 69. // When validation fails or other local issues 70. $this->errors[] = Tools::displayError('Error: Authentication failed.'); 71. } 72. JxHeaderAccountFacebookLinkModuleFrontController->initContent - [line 281 - classes/controller/Controller.php] 276. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 277. $this->initHeader(); 278. } 279. 280. if ($this->viewAccess()) { 281. $this->initContent(); 282. } else { 283. $this->errors[] = $this->trans('Access denied.', array(), 'Admin.Notifications.Error'); 284. } 285. 286. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) { ControllerCore->run - [line 511 - classes/Dispatcher.php] 506. if (isset($params_hook_action_dispatcher)) { 507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher); 508. } 509. 510. // Running controller 511. $controller->run(); 512. 513. // Execute hook dispatcher after 514. if (isset($params_hook_action_dispatcher)) { 515. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher); 516. } DispatcherCore->dispatch - [line 28 - index.php] 23. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) 24. * International Registered Trademark & Property of PrestaShop SA 25. */ 26. 27. require(dirname(__FILE__).'/config/config.inc.php'); 28. Dispatcher::getInstance()->dispatch Edited June 20, 2019 by Jozikas (see edit history) Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted June 20, 2019 Share Posted June 20, 2019 try to replace line 70 with: $this->errors[] = $ex->getMessage(); What message is shown now? 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