cedib Posted September 24, 2019 Share Posted September 24, 2019 Hi, I keep having this warning in the console for a Prestashop 1.6.1.24 on PHP 7.1: PHP Warning: Declaration of ModuleFrontControllerCore::setTemplate($template) should be compatible with FrontController::setTemplate($default_template, $layout = NULL) in /home/dgyhqty/public_html/classes/controller/ModuleFrontController.php on line 30 Does anyone know what it means? Thanks Link to comment Share on other sites More sharing options...
joseantgv Posted September 25, 2019 Share Posted September 25, 2019 You have a modification at function setTemplate() from /classes/controller/FrontController.php, it should be: public function setTemplate($default_template) { if ($this->useMobileTheme()) { $this->setMobileTemplate($default_template); } else { $template = $this->getOverrideTemplate(); if ($template) { parent::setTemplate($template); } else { parent::setTemplate($default_template); } } } Someone has modified the core. Link to comment Share on other sites More sharing options...
cedib Posted September 25, 2019 Author Share Posted September 25, 2019 This is what I have in the file. It's not modified. I've actually replaced it with a fresh one from a new download on prestashop.com to check if indeed the core file was modified. But it appears it's not the case. Link to comment Share on other sites More sharing options...
joseantgv Posted September 25, 2019 Share Posted September 25, 2019 Maybe you have this class overrided? Link to comment Share on other sites More sharing options...
cedib Posted September 30, 2019 Author Share Posted September 30, 2019 I have 2 overrides in the Override folder: File ModuleFrontController.php: class ModuleFrontController extends ModuleFrontControllerCore { public function setTemplate($template, $layout = null) { if (!$path = $this->getTemplatePath($template)) throw new PrestaShopException("Template '$template' not found"); $this->template = $path; } } And file FrontController.php that includes: public function setTemplate($default_template, $layout = null) { $this->_layout = $layout; if ($layout === false) { $this->display_header = false; $this->display_footer = false; } return parent::setTemplate($default_template); } Could it be one of them? But I don't what they are for, they were put there by previous developers. 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