Define a method called publishTraverse(same args as __bobo_traverse__
) and invoke the existing __bobo_traverse__
from it.
Can a view define a __bobo_traverse__ method?
-
18-07-2023 - |
質問
I am trying to make ARFilePreview work with newer versions of Plone. The product defines a view which has its own __bobo_traverse__
method. Unfortunately ZPublisher does not invoke this method.
The traverseName()
method in BaseRequest.py
has:
if IPublishTraverse.providedBy(ob):
ob2 = ob.publishTraverse(self, name)
else:
adapter = queryMultiAdapter((ob, self), IPublishTraverse)
if adapter is None:
## Zope2 doesn't set up its own adapters in a lot of cases
## so we will just use a default adapter.
adapter = DefaultPublishTraverse(ob, self)
ob2 = adapter.publishTraverse(self, name)
I would like it to take the else case but it results in a 404 because the if returns True.
Is there an easy fix?
解決
所属していません StackOverflow