ajaxthemestudios Posted July 30, 2018 Share Posted July 30, 2018 (edited) Hello I wanted to hook the social media follow module to the displayMaintenance hook but it came up with an error: ContextErrorException in Module.php line 2221: Notice: Trying to get property of non-object According to this documentation, this hook displays new elements on the maintenance page. Same thing happens when you try to use a global variable that contains {$urls} like {$urls.theme_assets} and {$urls.base_url} Is this a bug or am I doing anything wrong? Edited July 31, 2018 by ajaxthemestudios Spelling correction (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted July 31, 2018 Share Posted July 31, 2018 Hello, I think you are wrong, the variable {$urls} exist only in the tpl where it was added, but in PS 1,7 there is a new way to get the url inside of any Smarty file, here an explanation: https://webkul.com/blog/links-creation-on-tpl-files-in-prestashop-1-7-using-url/ And there is one more there in the PrestaShop blog, but I can't find it. Regards! Link to comment Share on other sites More sharing options...
ajaxthemestudios Posted July 31, 2018 Author Share Posted July 31, 2018 1 hour ago, Rolige said: Hello, I think you are wrong, the variable {$urls} exist only in the tpl where it was added, but in PS 1,7 there is a new way to get the url inside of any Smarty file, here an explanation: https://webkul.com/blog/links-creation-on-tpl-files-in-prestashop-1-7-using-url/ And there is one more there in the PrestaShop blog, but I can't find it. Regards! Thanks for your response. Inserting those variables inside maintenance.tpl brings those errors. I have tested it, It seems it only accept global variables that generates shop information such as shop logo, shop name, etc. The ones for customers, orders or urls gives those errors. Thanks for the link. I will study it and see if it solves the problems. 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