Question

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?

Was it helpful?

Solution

Define a method called publishTraverse(same args as __bobo_traverse__) and invoke the existing __bobo_traverse__ from it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top