Ticket #8090 (closed Bug: wontfix)

Opened 7 years ago

Last modified 3 years ago

Redirect-Exception throws error in portlet safe_renderer

Reported by: saily Owned by:
Priority: trivial Milestone: 3.3.x
Component: General Version:
Keywords: Cc:

Description

i'm using redirect-exceptions in my zope formlib actions. if i use formlib in portlets the redirect exception is not caught and the portlet throws an error.

...
from zExceptions import Redirect
...


@form.action(_(u"Save"))
def action_save(self, action, data):
    ...
    transaction.commit()
    ...
    raise Redirect("@@some_view")

this works correctly in forms, but not in form-portlets.

Change History

comment:1 Changed 7 years ago by saily

i tried this, works.

    from zExceptions import Redirect
    
    def safe_render(self, portlet_renderer):
        try:
            return portlet_renderer.render()
        except Redirect, ConflictError:
            raise
        except Exception:
            logger.exception('Error while rendering %r' % (self,))
            aq_acquire(self, 'error_log').raising(sys.exc_info())
            return self.error_message()

so if somebody needs this too, we should probably fix it in plone.app.portlets/plone/app/portlets/manager.py or use self.request.RESPONSE.redirect('@@some_url') instead.

comment:2 Changed 7 years ago by hannosch

  • Owner changed from somebody to optilude
  • Component changed from Unknown to Portlets

comment:3 Changed 6 years ago by hannosch

  • Owner optilude deleted
  • Component changed from Portlets to Infrastructure

comment:4 Changed 3 years ago by ida

  • Status changed from new to closed
  • Resolution set to wontfix

Are you still experiencing the issue in Plone-4.x ? Otherwise this ticket could be closed, as Plone-3.x is not supported anymore.

comment:5 Changed 3 years ago by davisagli

  • Component changed from Infrastructure to General
Note: See TracTickets for help on using tickets.