Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
I have some problems with caching attributes. I've registered a function
like this:
$GLOBALS['smarty']->register_function('recent_articles',
'do_recent_articles', false, array('article_id','category_id'));
When using the cache version of the script i get the following errors:
Warning: current() [function.current]: Passed variable is not an array or
object in smarty263\Smarty.class.php on line 1899
Warning: next() [function.next]: Passed variable is not an array or object
in smarty263\Smarty.class.php on line 1900
The error is easily fixed with a is_array() check before lines 1899-1900,
but that maybe break other stuff.
Another thing is that the cached version doesn't work because the function
doesn't get the required parameters ('article_id','category_id'). But if I
use the following instead
$GLOBALS['smarty']->register_function('recent_articles',
'do_recent_articles', false, array('article_id' => 1,'category_id' => 1));
The functions receives the correct values (not 1 and 1), but the PHP error
is still there.
Any ideas? Is this a bug?
Cheers
Martin
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.