Ticket #12772 (confirmed Bug)

Opened 4 years ago

Last modified 21 months ago

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

resourceregistries_redirect.patch Download (2.2 KB) - added by dieter 4 years ago.
simple patch to work around the problem (no general solution)

Change History

Changed 4 years ago by dieter

simple patch to work around the problem (no general solution)

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:3 Changed 4 years ago by garbas

  • Cc elro added

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:5 Changed 4 years ago by micha137

  • Cc micha137 added

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

comment:7 Changed 2 years ago by dholth

This bug took about a day of my time in Plone 4.3.2/4.3.3. My solution was to stop using inline javascripts and/or CSS.

comment:8 Changed 21 months ago by spanish

The same problem in Plone 4.1.6. resourceregistries_redirect.patch fixes the problem.

Note: See TracTickets for help on using tickets.