[Zope] odd behavior when External Method calls DTML Method

Brian Withun brianw@hilgraeve.com
Tue, 16 Apr 2002 17:50:23 -0400


I am experiencing some kind of acquisition problem when calling DTML Methods
from External Methods

In a nutshell, I have a dtml method:

---------------------(test1_dtml)---
<dtml-var URL>
------------------------------------

...which renders fine when I view it using a web browser.
When I test an external method which calls this DTML method, however,
I get this traceback:

Traceback (innermost last):
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 150, in publish_module
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 114, in publish
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/Zope/__init__.py, line
158, in zpublisher_exception_hook
    (Object: Test)
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 98, in publish
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/mapply.py,
line 88, in mapply
    (Object: test1)
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/ZPublisher/Publish.py,
line 39, in call_object
    (Object: test1)
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/Products/ExternalMethod/External
Method.py, line 202, in __call__
    (Object: test1)
    (Info: ((<Folder instance at 89f8ac8>,), {}, None))
  File /home/zope/2-5-0/lib/python/Products/Model/Extensions/XmlRpc.py, line
66, in Test_test1
    (Object: Test)
  File /usr/local/Zope-2.5.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line
127, in __call__
    (Object: test1_dtml)
  File
/usr/local/Zope-2.5.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py,
line 473, in __call__
    (Object: test1_dtml)
KeyError: URL

This is the module containing the function for my External Method:

--------------------(myModule.py)---
def test1( self ):
  return self.Test.test1_dtml( self )
------------------------------------

Curiously, though my DTML Method '''<dtml-var URL>''' does not work, if I
change it
to '''<dtml-var "REQUEST.get('URL')">''' it works fine.  ?????

Thanks to any Acquisition Gurus who can explain this.

Brian Withun
------------