[Zope-dev] exception views lost context on Zope 2.12

Martin Aspeli optilude+lists at gmail.com
Tue Feb 23 06:33:15 EST 2010


Wichert Akkerman wrote:
> On 2/23/10 11:09 , Hanno Schlichting wrote:
>> On Tue, Feb 23, 2010 at 10:56 AM, Wichert Akkerman<wichert at wiggy.net>   wrote:
>>> In Zope 2.10 exception views were acquisition-wrapped in the publisher
>>> context.
>> In Zope 2.10, exception views didn't exist in Zope2. They were only
>> introduced in Zope 2.11.
>
> And yet they work beautifully in a Plone 3 site.
>
>>> This appears to have changed in Zope 2.12: exception views are
>>> now wrapped in the exception. This is problematic since it means you can
>>> no longer use the context when rendering an error page, so things like
>>> ++resource++ or anything else which relies on a working acquisition
>>> context, which is pretty much everything, break.
>>>
>>> Is this an unexpected regression from the acquisition changes, or a
>>> deliberate change?
>> The exception view support in Zope3 and Zope2 has always been a view
>> on the exception value and the request. There's no context involved.
>> Not sure which backport or monkey patch you have been using in 2.10
>> here.
>
> perhaps plone.app.linkintegrity did something.

Yes, it adds a monkey patch to enable views-on-exceptions.

> At any rate without being
> able to access the context exception views are pretty much worthless, so
> we'll have to figure out some way of making it accesible.

The view definitely needs access to the exception. And it's an adapter 
on (exception, request), which is definitely correct. We can't change that.

Other than that, making it possible to access the real context sounds 
useful.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-Dev mailing list