[Zope] Acquisition change between Zope 1 and 2?

Andrew M. Kuchling akuchlin@mems-exchange.org
Thu, 5 Aug 1999 14:01:48 -0400 (EDT)


Today I moved some code from Zope 1 to 2, and ran into an
incompatibility.  

I have a folder named 'process' with various bits of DTML in it.  One
DTML document called matching_html contains <!--#var
add_operation_link-->.  add_operation_link is a DTML method; in
the process folder, it's empty.  In a subfolder of 'process', I create a
different add_operation_link DTML method which contains some actual
content.  The intention is to have a hook; subfolders of 'process' can
override it to insert a bit of their own content, avoiding the need to
modify more complex DTML methods.

In Zope 1, this works as I expect; subfolders define
add_operation_link, they acquire matching_html from the parent folder,
and it calls the locally-defined add_operation_link.  

In Zope 2b1, this breaks because the matching_html in the parent
folder calls the version of add_operation_link in the same folder; the
overridden version of add_operation_link is never called.  If I copy
matching_html into the subfolders, it now calls the overridden
add_operation_link, but now I have duplicate code to maintain and
debug.

Is this a bug in 2.0b1 or a deliberate change?  If the latter, what
are the semantics that changed, and how do I write hooks like this?
And won't this break a lot of code?

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
Oh, by the way, talking of eggs, I want a four-hour scan below the hydrogen
line tomorrow; I'll give you the precise wavelength later.
    -- One of the astronomers, in "Terror of the Autons"