[Zope] RE: Bizarre error with standard_html_header

Martijn Pieters mj@digicool.com
Wed, 12 Jul 2000 15:55:56 +0200


On Wed, Jul 12, 2000 at 05:36:26PM +1000, Curtis Maloney wrote:
> The traceback was in my original message.  I will give you a new one this 
> time, since i have managed to move along a _tiny_ ammount, but still get the 
> same error.

Found it now. There were two copies of your message, and I found the one
without the trace.

> >
> > I also see that you are making assumptions about acquisition context. An
> > acquired message does not autmatically also acquire the context of the
> > caller. See several articles and How-To's by Jim Fulton and Shane Hathaway
> > on Zope.org.
> 
> Hmm.. so, if i request http://mysite/internal/register
> and it acquires the DTML Document 'register' from mysite/ into internal
> register won't neccesarily be in the internal/ namespace?
> 
> Erm.... my Zope world is crumbling!  It all seemed so simple before...
> 
> Then again, when you can't trust the id, what can you trust? (o8

register will look in internal for objects, but only if it can't find them
first in the mysite (root) object. Read Jim's acquisition algebra texts:

  http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/

So we have:

  mysite/

    standard_html_header
    register

    internal/

      standard_html_header

and you are calling mysite.internal.register, which in turn tries to call
mysite.internal.register.standard_html_header. mysite.internal.register is, in
Jim's algebra: ((register o mysite) o (internal o mysite)), so when register
tries to call standard_html_header, it will go from left to right through this
list, and will find mysite.standard_html_header first.

If this worries you about your view of Zope, you're about to reach your next
level of Zope Zen. =)

>   File /usr/local/Zope-2.1.6-src/lib/python/OFS/DTMLMethod.py, line 146, in 
> __call__
>     (Object: standard_html_header)
>   File /usr/local/Zope-2.1.6-src/lib/python/DocumentTemplate/DT_String.py, 
> line 502, in __call__
>     (Object: standard_html_header)
> TypeError: (see above)

The first 3 lines let us know that we are _inside_ an object called
standard_html_header. In your case this will be the on in the root Folder of
your site, I suspect. 

What actually goes wrong I don't know. It _probably_ goes wrong inside the
rendering of this object, but this is masked, I think, by the fact that the
next step on the stack is in render_blocks, which is implemented in C.

-- 
Martijn Pieters
| Software Engineer            mailto:mj@digicool.com
| Digital Creations          http://www.digicool.com/
| Creators of Zope               http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-----------------------------------------------------