[Zope] dtml-var AND dtml-tree

Jim Washington jwashin@vt.edu
Thu, 12 Apr 2001 11:58:41 -0400


"Thomas B. Passin" wrote:
> 
> Danny William Adair wrote -
> 
> > For the people who have problems with dtml-tree's "urlparam" only handling
> > constants...
> >
> > I patched "lib/python/TreeDisplay/TreeTag.py" so that I can have a
> parameter
> > "urlparam_var", an object on the namespace that holds the querystring I
> want
> > to insert. This is the first time I patched zope internals, but it works
> > fine. Maybe someone who knows better can comment on this.
> >
> 
> It's always a temptation to patch and add features since it's so easy to do
> with Zope.    But it's a bit dangerous because the changes could get lost or
> forgotten when you upgrade to a new version. Also, other people can't use
> your code unless they install the changes too.
> 

Patches like this probably should be done in a manner like hot-fix
products.  DC's hot-fixes reside in the Products directory and generally
override a Zope internal function or two.  Take a look at one.  They are
not very complicated.

The nice thing with a hot-fix-like product is that if you decide it does
bad voodoo (and presumably does not corrupt your ZODB), you still have
your functioning zope installation if you remove the product from the
Products folder and restart.  No worries about finding the files you
patched and getting everything back the way it was.

A minor bad thing would be if a function you are overriding gets updated
in a substantial way in a new release, but it should be a simple matter
to check to see that your overriding functions still do substantially
what the upgraded originals do.  Come to think of it, it would be about
the same effort as would be required for re-patching the source for
every new release.  

-- Jim Washington