Hi <br><br>I am running COREBlog2 0.9b on Plone 2.5.1 and am having a problem getting a redirect to happen after I change the state of a comment. <br><br>I had set up a workflow for blog comments where their initial state is pending. In order to make it simple for my bloggers I want them to just have to chose one of 2 options from the state dropdown when they are reviewing comments either &quot;Publish&quot; or &quot;Reject&quot;. I thought the simplest thing for comments that where rejected would be for their state to be changed to private so they would then only be visible to the Manager and for the reviewer they would disappear from view. The Manager could then clean out any obvious spam from easily by using the comments folder but ones that where rejected for other reasons could be kept for reference and historical purposes. 
<br><br>As the default behaviour of a change of state on comment that is up for review is to display the comment I had the problem where once the comment state was changed to &quot;Rejected&quot; by the reviewer they would be shown the login page. I thought the easiest way to get around this would be to have a script that was called after the reject transition and redirected the user to the root page of the blog. This is simple to do from a script you add to a folder:
<br><br>url = context.portal_url.getPortalPath() + &#39;/blog&#39;<br><br>return context.REQUEST[&#39;RESPONSE&#39;].redirect(url)<br><br>If I test that it works perfectly, however trying to get this to work when called off a script in a reject transition has been a major exercise in frustration. Below is an example of an external method that I have written to attempt this, I moved on to external methods after having no luck getting something similar to work as a script. I have also tried:
<br><br>return obj.REQUEST[&#39;RESPONSE&#39;].redirect(url)<br><br>but that did nothing as well. I get no error messages just no redirect happens and i see the object in its private state. The redirect does not happen if I run it as a manager, and I have tried having a news item use the same workflow with the same result as my coreblog comments. I am obviously missing some critical piece of understanding about how objects move through a transition or something along those lines but after days of googling, reading through the Zopebook scripting chapters searching mailing lists and looking at the various scripts in the source that mention redirect I have no idea what it is. Any clues, pointers would be greatly appreciated. 
<br clear="all"> <br>----------------------------------------------<br>#!/usr/bin/python<br>##external method to redirect from comment to parent<br><br>def redirectTo(self):<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj = self.object<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.plone_log
(&#39;Beginning redirectExt&#39;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url = obj.portal_url.getPortalPath() + &#39;/blog&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.plone_log(url)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.REQUEST[&#39;RESPONSE&#39;].redirect(url)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.plone_log
(&#39;after the redirect&#39;)<br>--------------------------------------------------<br><br>cheers<br>John<br><br>-- <br>John Habermann<br>Internet Programmer, System Administrator<br>The Wilderness Society Inc<br><a href="http://www.wilderness.org.au">
http://www.wilderness.org.au</a>