Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Migration to 3.1.34 breaks ?

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Keorl
Smarty n00b


Joined: 24 Jan 2020
Posts: 2

PostPosted: Fri Jan 24, 2020 9:00 am    Post subject: Migration to 3.1.34 breaks ? Reply with quote

Hi,
I have a php5.3 project that was using smarty 3.1.18.
I'm migrating the project to php7.3 and upgrading all libraries. Replaced smarty with latest 3.1.34, thinking it was only a minor version change so it would be easy.
Also checked the main page (https://www.smarty.net/) and see no mention of breaking changes.

However, it did break.
I get this :
Code:

Warning: Invalid argument supplied for foreach() in C:\wamp\www\core\smarty\sysplugins\smarty_internal_resource_file.php on line 161

Fatal error: Uncaught --> Smarty: Unable to load template 'file:back.tpl' <-- thrown in C:\wamp\www\core\smarty\sysplugins\smarty_internal_template.php on line 195


I replaced my
Code:
require('smarty/smarty.class.php');

with
Code:
require('smarty/Autoloader.php');
Smarty_Autoloader::register();


Still have the same error.
Is there any important breaking change that I should know of, or is it a bug in 3.1.34 ?[/code]


Last edited by Keorl on Fri Jan 24, 2020 9:32 am; edited 1 time in total
Back to top
View user's profile Send private message
Keorl
Smarty n00b


Joined: 24 Jan 2020
Posts: 2

PostPosted: Fri Jan 24, 2020 9:28 am    Post subject: Reply with quote

for anyone encountering the same error, here is what broke :

Code:
$this->template_dir = SMARTY_TEMPLATE_DIR."/$module/";


I replaced with this and it works :
Code:
$this->setTemplateDir(SMARTY_TEMPLATE_DIR."/$module/");


No idea what people in 2014 wrote "template_dir = " instead of using setTemplateDir() like they did literally 10 lines of code above and again below.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP