Re: [SMARTY] The dreaded 'Fatal error: Call to undefined function: ()' error

From: Date: Tue, 30 Jul 2002 13:33:38 +0000
Subject: Re: [SMARTY] The dreaded 'Fatal error: Call to undefined function: ()' error
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5509@lists.php.net to get a copy of this message
You should always get other warnings before your "undefined function" errors, something like this: PHP Warning: Smarty plugin error: [in index.tpl line 7]: modifier 'upper' is not implemented in /path/to/Smarty.class.php on line 1958 <br /> PHP Warning: Smarty plugin error: [in index.tpl line 13]: unknown tag - 'html_select_date' in /path/to/Smarty.class.php on line 1958 <br /> If those functions don't get defined (by loading the plugin), then you will get undefined function errors. I don't think it would be correct to supress them, they are errors that happen. In this guys case, he wouldn't have seen any errors, making things even more difficult to debug. Monte Ferdinand Beyer wrote:
On 30 Jul 2002 at 13:11, Tim Fountain wrote:
As the _get_plugins_filepath() function appears to check whether the plugins path is readable before it returns the path, it would be useful if Smarty could be changed in future versions so that if this function returns false an error message is displayed. At the moment Smarty just goes ahead with processing anyway, and will then fall down when it comes across some plugin-related code.
I'm not sure on this. In my Smarty experience, it always toggles a warning if it cannot load a function. Check your error_reporting setup and make sure that it includes warnings (e.g. E_ALL ^ E_NOTICE). But you're right: Smarty should suppress a undefined-function fatal error - ie. by checking if a plugin is loaded before calling it in the compiled template. Monte, what's your opinion on this?
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#5509) next »