Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

undefined extension class 'Smarty_Internal_Method_Get_Templa

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
tarmstrong
Smarty n00b


Joined: 15 Feb 2016
Posts: 3

PostPosted: Mon Dec 02, 2019 5:27 pm    Post subject: undefined extension class 'Smarty_Internal_Method_Get_Templa Reply with quote

I'm trying to migrate from my old PHP 5.4.45 + Smarty 2.6.28 to my new PHP 7.2.25 + Smarty 3.1.33.

I'm tuning some small pieces of code, it works in most of webpages, but suddenly it stop working in some PHP pages, returning the following error message:


Code:
    Notice: Undefined property: Smarty_Internal_Undefined::$objMap in /home/www/libs/Smarty-3.1.33/libs/sysplugins/smarty_internal_extension_handler.php on line 132
    Fatal error: Uncaught --> Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars' <-- thrown in /home/www/libs/Smarty-3.1.33/libs/sysplugins/smarty_internal_undefined.php on line 62



I can not figure out which PHP code is causing this error message, since I do not see within it any line position to analyze. It seems that the PHP code of these pages are very similar to the pages which work ok. I've read on the Internet that this error may be caused by 'register_object' in PHP. I've just checked my PHP files, and there is no 'register_object' within them.

In the not-working PHP pages (as in the working ones), additionally to the rest of the PHP operations, I do just:

Code:
    $myTemplate = new Smarty();
    $myTemplate->compile_dir = $mypath . "/templates_c";
    $myTemplate->template_dir = $mypath . "/templates";
    $myTemplate->assign("myvarible", $foo);
    $myTemplate->display("mytemplate.html");


Any help is appreciated. Thank you very much.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Dec 03, 2019 10:36 pm    Post subject: Reply with quote

How do you load Smarty?
If you just include Smarty class, that is not enough.
You should include Smarty bootstrap instead, or use Composer-provided autoloader.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Wed Dec 04, 2019 2:43 am    Post subject: Reply with quote

You can try (if you have permission to do this) installing XDebug for PHP.

On error, XDebug will print a stack trace that shows how PHP got to the pont in question.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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