sampsonzak Posted February 10, 2023 Share Posted February 10, 2023 Hi, I enabled debug mode as trying to add something to one of my TPL files, however with everything completely standard / unchanged, I am receiving an error after debug mode was activated, this is on a product page (Works fine, without issue with debug mode turned off): Whoops, looks like something went wrong. (1/1) ContextErrorException Notice: Trying to access array offset on value of type null in 35655e6409b6198f29dd6e732ef9598dec599880_2.module.psshoppingcartpsshoppingc.php line 78 at content_63e699a75bbc19_76670944() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute() in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch() in SmartyDevTemplate.php line 40 at SmartyDevTemplateCore->fetch() in Module.php line 2490 at ModuleCore->fetch() in ps_shoppingcart.php line 116 at Ps_Shoppingcart->renderWidget() in Hook.php line 1017 at HookCore::coreRenderWidget() in Hook.php line 964 at HookCore::exec() in smarty.config.inc.php line 167 at smartyHook() in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call() in f3004da626f83982799566b687929b252b66e29c_2.file.desk-header-2.tpl.php line 51 at content_63e699a7538147_98028819() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in fa751e24efbb5c5e74a1bf62f8734b44481d603b_2.file.desktop-header.tpl.php line 25 at content_63e699a752ede6_61976938() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in de69074b52c51e61dc86abbaabd2bc81c8daaf4c_2.file.header.tpl.php line 55 at Block_91544304863e699a752a163_49338655->callBlock() in smarty_internal_runtime_inheritance.php line 248 at Smarty_Internal_Runtime_Inheritance->callBlock() in smarty_internal_runtime_inheritance.php line 184 at Smarty_Internal_Runtime_Inheritance->process() in smarty_internal_runtime_inheritance.php line 156 at Smarty_Internal_Runtime_Inheritance->instanceBlock() in de69074b52c51e61dc86abbaabd2bc81c8daaf4c_2.file.header.tpl.php line 29 at content_63e699a752c307_02489190() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in b868274d646dfa34257e9f9285a4e93b5e9c71ec_2.file.layout-both-columns.tpl.php line 144 at Block_124926832663e699a74b1b54_33117649->callBlock() in smarty_internal_runtime_inheritance.php line 248 at Smarty_Internal_Runtime_Inheritance->callBlock() in smarty_internal_runtime_inheritance.php line 184 at Smarty_Internal_Runtime_Inheritance->process() in smarty_internal_runtime_inheritance.php line 156 at Smarty_Internal_Runtime_Inheritance->instanceBlock() in b868274d646dfa34257e9f9285a4e93b5e9c71ec_2.file.layout-both-columns.tpl.php line 64 at content_63e699a74c17e9_66376841() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in smarty_internal_runtime_inheritance.php line 116 at Smarty_Internal_Runtime_Inheritance->endChild() in df51a7f9824386d44e2147ebd995a098cf704f06_2.file.layout-full-width.tpl.php line 29 at content_63e699a74a8909_10143278() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in smarty_internal_runtime_inheritance.php line 116 at Smarty_Internal_Runtime_Inheritance->endChild() in 1c99fc7a312466b3871eec1c058fcda66dcc460d_2.file.product.tpl.php line 35 at content_63e699a74a1e15_85204364() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute() in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch() in SmartyDev.php line 40 at SmartyDev->fetch() in FrontController.php line 727 at FrontControllerCore->smartyOutputContent() in FrontController.php line 709 at FrontControllerCore->display() in Controller.php line 326 at ControllerCore->run() in Dispatcher.php line 525 at DispatcherCore->dispatch() in index.php line 30 Anyone have any idea why this is happening? PHP 7.4, PrestaShop 1.7.8.8 Thank you! Link to comment Share on other sites More sharing options...
arunvishwakarama Posted February 11, 2023 Share Posted February 11, 2023 17 hours ago, sampsonzak said: Hi, I enabled debug mode as trying to add something to one of my TPL files, however with everything completely standard / unchanged, I am receiving an error after debug mode was activated, this is on a product page (Works fine, without issue with debug mode turned off): Whoops, looks like something went wrong. (1/1) ContextErrorException Notice: Trying to access array offset on value of type null in 35655e6409b6198f29dd6e732ef9598dec599880_2.module.psshoppingcartpsshoppingc.php line 78 at content_63e699a75bbc19_76670944() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute() in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch() in SmartyDevTemplate.php line 40 at SmartyDevTemplateCore->fetch() in Module.php line 2490 at ModuleCore->fetch() in ps_shoppingcart.php line 116 at Ps_Shoppingcart->renderWidget() in Hook.php line 1017 at HookCore::coreRenderWidget() in Hook.php line 964 at HookCore::exec() in smarty.config.inc.php line 167 at smartyHook() in SmartyLazyRegister.php line 83 at SmartyLazyRegister->__call() in f3004da626f83982799566b687929b252b66e29c_2.file.desk-header-2.tpl.php line 51 at content_63e699a7538147_98028819() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in fa751e24efbb5c5e74a1bf62f8734b44481d603b_2.file.desktop-header.tpl.php line 25 at content_63e699a752ede6_61976938() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in de69074b52c51e61dc86abbaabd2bc81c8daaf4c_2.file.header.tpl.php line 55 at Block_91544304863e699a752a163_49338655->callBlock() in smarty_internal_runtime_inheritance.php line 248 at Smarty_Internal_Runtime_Inheritance->callBlock() in smarty_internal_runtime_inheritance.php line 184 at Smarty_Internal_Runtime_Inheritance->process() in smarty_internal_runtime_inheritance.php line 156 at Smarty_Internal_Runtime_Inheritance->instanceBlock() in de69074b52c51e61dc86abbaabd2bc81c8daaf4c_2.file.header.tpl.php line 29 at content_63e699a752c307_02489190() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in b868274d646dfa34257e9f9285a4e93b5e9c71ec_2.file.layout-both-columns.tpl.php line 144 at Block_124926832663e699a74b1b54_33117649->callBlock() in smarty_internal_runtime_inheritance.php line 248 at Smarty_Internal_Runtime_Inheritance->callBlock() in smarty_internal_runtime_inheritance.php line 184 at Smarty_Internal_Runtime_Inheritance->process() in smarty_internal_runtime_inheritance.php line 156 at Smarty_Internal_Runtime_Inheritance->instanceBlock() in b868274d646dfa34257e9f9285a4e93b5e9c71ec_2.file.layout-both-columns.tpl.php line 64 at content_63e699a74c17e9_66376841() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in smarty_internal_runtime_inheritance.php line 116 at Smarty_Internal_Runtime_Inheritance->endChild() in df51a7f9824386d44e2147ebd995a098cf704f06_2.file.layout-full-width.tpl.php line 29 at content_63e699a74a8909_10143278() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_template.php line 385 at Smarty_Internal_Template->_subTemplateRender() in smarty_internal_runtime_inheritance.php line 116 at Smarty_Internal_Runtime_Inheritance->endChild() in 1c99fc7a312466b3871eec1c058fcda66dcc460d_2.file.product.tpl.php line 35 at content_63e699a74a1e15_85204364() in smarty_template_resource_base.php line 123 at Smarty_Template_Resource_Base->getRenderedTemplateCode() in smarty_template_compiled.php line 114 at Smarty_Template_Compiled->render() in smarty_internal_template.php line 216 at Smarty_Internal_Template->render() in smarty_internal_templatebase.php line 232 at Smarty_Internal_TemplateBase->_execute() in smarty_internal_templatebase.php line 116 at Smarty_Internal_TemplateBase->fetch() in SmartyDev.php line 40 at SmartyDev->fetch() in FrontController.php line 727 at FrontControllerCore->smartyOutputContent() in FrontController.php line 709 at FrontControllerCore->display() in Controller.php line 326 at ControllerCore->run() in Dispatcher.php line 525 at DispatcherCore->dispatch() in index.php line 30 Anyone have any idea why this is happening? PHP 7.4, PrestaShop 1.7.8.8 Thank you! There is some value which was used in template as array but it is null currently so it's showing error when debug mode enabled else working fine you can add isset there to check array index and add else value and it should be fine in debug mode too Link to comment Share on other sites More sharing options...
sampsonzak Posted February 11, 2023 Author Share Posted February 11, 2023 58 minutes ago, arunvishwakarama said: There is some value which was used in template as array but it is null currently so it's showing error when debug mode enabled else working fine you can add isset there to check array index and add else value and it should be fine in debug mode too Hi, Thanks. The error seems to be from the PS Shopping Cart though which is a native module so I'm a bit confused. I also tried looking for the file: in 35655e6409b6198f29dd6e732ef9598dec599880_2.module.psshoppingcartpsshoppingc.php line 7 in modules/ps_shoppingcart/ - there is a psshoppingcart.php, but cannot see any file called "psshoppingcartpsshoppingc.php" - where would this be? Thanks Link to comment Share on other sites More sharing options...
arunvishwakarama Posted February 11, 2023 Share Posted February 11, 2023 That file generated dynamically in cache folder the concern is related to tpl file Though that is notice you can skip else need to review that template and find that line and add check there Link to comment Share on other sites More sharing options...
sampsonzak Posted February 11, 2023 Author Share Posted February 11, 2023 54 minutes ago, arunvishwakarama said: That file generated dynamically in cache folder the concern is related to tpl file Though that is notice you can skip else need to review that template and find that line and add check there Hi, Thank you. I see the error mentions multiple .tpl files - so I need to fix this problem in all of the displayed .tpl files? Or just the first .tpl file? Thanks again Link to comment Share on other sites More sharing options...
arunvishwakarama Posted February 13, 2023 Share Posted February 13, 2023 Such warnings may be in others templates so need to fix all of you want that to work on debug mode or you can disable notice from debug mode then all will be fine 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