Ticket #12772 (confirmed Bug)
Products.ResourceRegistries: "inline" resouces fail with "redirect"
Reported by: | dieter | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | Backend (Python) | Version: | 3.3 |
Keywords: | patch | Cc: | elro, micha137 |
Description
This problem is related to #11397 (but a bit different).
I have a "zope.formlib" form that performs a "response.redirect" in one of its actions. I addition, I have a Zope 3 resource managed by "portal_javascripts" with "inline rendering". Activating the action fails with an "AssertionError" from "Products.ResourceRegistries.BaseRegistry.BaseRegistry._restoreCachingHeaders". It finds the "302" response status set by the "response.redirect" and raises an "AssertionError".
Many of the "ResourceRegistries" problems result from the fact that it is abusing an interface destined for web access. The necessary hacks are very error prone and lead to really nasty error. I suggest to overhaul "ResoucreRegistries" completely: instead of patching the real request and response (used by the web request), set up an environment with a new (pristine) request and response. This would have a chance to be more robust.
Attachments
Change History
Changed 4 years ago by dieter
-
attachment
resourceregistries_redirect.patch
added
comment:1 Changed 4 years ago by eleddy
- Status changed from new to confirmed
is this in plone 4 too?
comment:2 Changed 4 years ago by garbas
from just looking at the code, it looks like this is still the case in plone 4
comment:4 Changed 4 years ago by kleist
- Keywords patch added
- Component changed from Unknown to Backend (Python)
- Milestone changed from 3.x to 4.x
comment:6 Changed 3 years ago by avolkov
I can confirm that this bug occurs in Plone 4.1.4 when using inline javascripts, when a non-existent object is requested, instead of 404 Plone page (default_error_message.pt), zope "Not found" message is displayed.
Patch resourceregistries_redirect.patch fixes the problem.
More details on the issue could be found here -- http://stackoverflow.com/questions/12735405/not-found-site-error-while-rendering-404-page-in-plone-4-1-4
simple patch to work around the problem (no general solution)