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

From: Date: Wed, 31 Jul 2002 13:19:57 +0000
Subject: Re: [SMARTY] The dreaded 'Fatal error: Call to undefined function: ()' error
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5533@lists.php.net to get a copy of this message
It does display an error when a plugin doesn't get loaded, it comes before the "undefined function" error(s). I'm not sure why you're not seeing it. Tim Fountain wrote:
On Tuesday, July 30, 2002, Ferdinand Beyer wrote:
On 30 Jul 2002 at 13:11, Tim Fountain wrote:
it would be useful if Smarty could be changed in future versions so that if [the _get_plugins_filepath()] 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).
The error settings on my development server are E_ALL.
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.
That's not exactly what I was saying - I was saying Smarty should display an error if it fails to load a plugin, to prevent the cryptic error that may occur later when an undefined plugin is called. On the other hand, your templates may not use the plugin at all so not being able to load it wouldn't be a problem. It's a tricky one.
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

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