Jump to content

Recommended Posts

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

Share this post


Link to post
Share on other sites

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. 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites

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?

image.thumb.png.d135253f643259fd0774e4c150f69a2f.png

Share this post


Link to post
Share on other sites
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?

image.thumb.png.d135253f643259fd0774e4c150f69a2f.png

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.

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites
Posted (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

IMG_20190620_073610.jpg

Edited by Jozikas (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More