Item9741: CommentPlugin not honoring the "redirectto" parameter. Doesn't redirect after saving a comment.

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: FoswikiUIRest
Branches: trunk
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
It will not perform a redirect even though there's a
<input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" />

in the prompt's form. So some of the examples break (as well as some of my apps).

Oh it is called endPoint for REST handlers. But endPoint doesn't have the magic of Foswiki::redirectto() .

And CommentPlugin's explicit endPoint then does overrides any redirecttos of a custom template.

That is a general problem of all REST handlers in UI::Rest.pm: endPoint should not be executed when there already is a redirect being performed by the REST handler itself.

Imho, endPoint for REST handlers should be deprecated in favour or the more standard redirectto url param as being used by the other cgi scripts.

-- MichaelDaum - 23 Sep 2010

I agree with Michael. I had same problem with my MultiTopicSavePlugin.

-- KennethLavrsen - 23 Sep 2010

OK, do it. endPoint predated redirectto=, but it effectively duplicates it (though much, much worse).

-- CrawfordCurrie - 27 Sep 2010

In which sense is redirectto worse than endPoint?

-- MichaelDaum - 27 Sep 2010

I didn't say it was. I said endPoint is worse than redirectto. endPoint only allows you to redirect to a topic, which is less than flexible.

-- CrawfordCurrie - 04 Oct 2010

oic, of course.

-- MichaelDaum - 05 Oct 2010

This is too much change to go into 1.1.1

I am reassigning this to Minor so I can keep it visible as urgent but not in the release blocker list for 1.1.1

This redirect change is so significant that it needs weeks and weeks of testing before release. Not sure it should go into 1.1 at all.

-- KennethLavrsen - 19 Oct 2010

The issue is not with the plugin, it's with the core handling of rest scripts, and endPoint versus redirectto. The CommentPlugin uses endPoint which is the core recommended approach. Yes, CommentPlugin should change, but only inn response to this core change.

Reallocated appropriately.

It is not a release blocker, either. Regraded from Urgent to Normal.

-- CrawfordCurrie - 06 Apr 2011

I think that this behavior is changed in Foswiki 1.2 As of 1.2, the redirectto is used if present, and endpoint is only used if redirectto is missing. That decision is made in Foswiki::redirectto( $endPointl ): It ignores the passed endpoint url if the redirectto url param is defined.

I'm marking this as fixed in 1.2, though it needs review.

-- GeorgeClark - 21 Apr 2014

The code was in a sort of spaghetti mode. Works now anyway.

-- MichaelDaum - 22 Apr 2014

"Spaghetti mode" is a good term. I decided to bite the bullet and get rid of the old "endPoint" parameter and only support the standard "redirectto". Should be fixed from version 2.1 of the plugin.

-- CrawfordCurrie - 26 Apr 2014

 

ItemTemplate edit

Summary CommentPlugin not honoring the "redirectto" parameter. Doesn't redirect after saving a comment.
ReportedBy MichaelDaum
Codebase trunk
SVN Range
AppliesTo Engine
Component FoswikiUIRest
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:0bd1cf1df928
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:0bd1cf1df928
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r16 - 05 Jul 2015, GeorgeClark - This page was cached on 29 Jul 2016 - 06:13.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License