[pLog-svn] Smarty caching problem

Christoph Feddersen feddersen at herr-der-ringe-film.de
Mon Jan 30 11:55:40 GMT 2006


Ok, I did some some research on this using the authentication plugin.

The error "Call to a member function on a non-object in ...
^post.template.inc" is not a smarty or {dynamic} block issue.

Lifetype behaves like this:

Check if template caching is enabled

if enabled, see if we have a cached template and if it's still valid

If that's true, it doesn't load the plugins and most of the objects at all.

When rendering the cached template, smarty looks for the objects in it's
context, but they aren't there -> error

I identified two spots where this handled:
class/action/defaultaction.class.php line 71-74

class/view/blogview.class.php render()

The posts are set at the very end of the function, which is never called
when using a cached template.

So how to get around this?
Both, the defaultaction and blogview objects cannot decide if
a) a template contains a {dynamic} block or not
b) a plugins needs standard lifetype objects (posts, articles, comments,
user) to work with or not

The only one who knows is the plugin author. So this information may be
stored in the plugin.
1) a flag to set if this plugin is dynamic or not
2.a) an array to define the needed objects

This properties could be changed in the above mentioned functions to
load only these objects. What do you think of it?


Jon Daley wrote:
>     Yes, that is what I was talking about.  The problem occurs with
> using any lifetype class inside the dynamic block, which is what you
> have to do in order to get a lifetpe plugin.  The plugins I have looked
> at porting, are the authentication and google plugins, both currently
> sitting in the unported folder in subversion.


More information about the pLog-svn mailing list