Tags:
create new tag
, view all tags

Return from Edit needs flexibility

Here are use cases:

  • Edit an included section using MultiEditPlugin. Save the topic, or cancel. Suddenly you find yourself in a totally different topic from where you started.
  • Edit an action using the ActionTrackerPlugin. Same situation.

The problem is that the Edit screen does not (today) understand that it was invoked from a topic different than the one that is being edited. It should be passed a "return topic" which is the topic that is displayed once the edit completes.

-- Contributors: ThomasWeigert - 11 Nov 2006

Discussion

Odd. I'm pretty sure that I implemented a cgi parameter to Save that tells it where to go to, because in one of the tracking systems i left did needed to go back to the master query topic.

I couldn't find mention of it in TWikiScripts though. But definitely, a gotoTopicOnXXXX cgi parmeter is a very very useful thing.

-- SvenDowideit - 12 Nov 2006

The login screen uses a parameter "origurl" to record the originating URL before the redirect. Just telling you that so you can make them consistent if you do this. (Oh, and yes, I agree it's a good idea).

-- CrawfordCurrie - 12 Nov 2006

Thanks. origurl it is....

-- ThomasWeigert - 12 Nov 2006

Are we sure we want to call this origurl? Because it is a redirect, and we do not always return to the same topic. I would prefer to have it called redirecturl.

-- ArthurClemens - 03 Dec 2006

I don't care either way... the motivation behind origurl was that it is already used, and you can make some story around that from the point of view of the oops it is the originating url, even if it was not really the originating url. The oops is none the wiser...

-- ThomasWeigert - 03 Dec 2006

And because this feature is really handy for plugins, it would make sense to have a redirecttopic as well, that accepts TopicName as well as WebName.TopicName syntax.

-- ArthurClemens - 03 Dec 2006

Both cases are useful, a redirect top a topic and to a URL, respectively. We already have origurl, it might be better to keep that as an undocumented parameter and create a new redirectto parameter? I find action based names more intuitive.

-- PeterThoeny - 05 Dec 2006

I am a little confused what is being asked for here. Are we just talking about renaming the parameter? In both scripts? Or is there additional functionality I am missing?

-- ThomasWeigert - 05 Dec 2006

Here are the options:

  1. Keep origurl (status quo; leave it as is)
  2. Enhance origurl to accept also web.topic notation (confusing, parameter name does not match parameter)
  3. Add redirecturl and keep origurl as undocumented parameter; add redirecttopic (consistent, but two parameters for one type of action)
  4. Add redirectto and keep origurl as undocumented parameter; redirectto takes action for URL and web.topic (most consistent)

We can live with option 1 since it is already done. If we want to enhance I suggest to go for the last option, this for all scripts that understand the origurl parameter.

-- PeterThoeny - 05 Dec 2006

origurl has been introduced very recently, and has not been released yet. We could easily rename it. It would be great if redirectto could accept a url and a web.topic syntax.

-- ArthurClemens - 05 Dec 2006

origurl was released in 4.0.4 IIRC, though I could be wrong.

origurl is a hidden parameter (used only by the system) so you can rename it as you like, as long as you don't break anything. In respect of the options, I prefer to have things working consistently to help cut down on code bloat. I also strongly dislike undocumented parameters. So if you do this, please recode login to use the redirectto parameter.

-- CrawfordCurrie - 05 Dec 2006

Willing to do so, but cannot test the login as I don't have an installation that uses template login. Are there unit tests I could use to verify the correctness of the login portion?

-- ThomasWeigert - 06 Dec 2006

That URL parameter is most useful for TWiki applications. Thanks guys for doing that. Is that parameter going to be added to the save and edit scripts? As I understand right now it's only for the login script. BTW how do you tell what version of TWiki you are running? %WIKIVERSION% renders to Tue, 04 Jul 2006 build 10807 on my machine but then how do I know whether it 4.0.4 or 4.0.5?

-- StephaneLenclud - 07 Dec 2006

  1. It works for the save script.
  2. It should be on TWiki.WebHome

-- ArthurClemens - 07 Dec 2006

Thomas, the unit tests are necessary but not sufficient. If you write the code, I'd be happy to pick up where you leave off and test. Some day we will be able to write unit tests that test this sort of thing.

-- CrawfordCurrie - 08 Dec 2006

argh - found it - UserSpecifiedRedirect is the implementation from May 2004. it obviously never made it into the core

-- SvenDowideit - 08 Dec 2006

  1. If it's only the save script how can TWiki applications make use of it? In fact TWiki applications often implement HTML form sending you to the edit script then the user will typically do a save and then you want you to be redirected to the topic or URL of your choice. So IMHO that parameter should be in both edit and save the edit script just passing it to the save.
  2. I can't find the TWiki version in 4.0.4 like format on TWiki.WebHome but login has an origurl parameter documented on my installation which must be 4.0.4.

-- StephaneLenclud - 08 Dec 2006

on (1) this is how it works...

-- ThomasWeigert - 08 Dec 2006

Note that this feature breaks template login, and is also dangerous as it allows use of the wiki for phishing attacks.For these reasons I have renamed it to redirecturl and have required a cfg var to enable it, with an appropriate warning.

-- CrawfordCurrie - 15 Dec 2006

How would this work, phishing with TWiki?

Is there another way that for instance CommentPlugin could implement this safely?

-- ArthurClemens - 15 Dec 2006

Crawford, why not redirectto that understands web.topics and URLs? Now we would need redirecturl and redirecttopic which is more maintenance and documentation.

-- PeterThoeny - 15 Dec 2006

Because I'm not interested in mucking about with it. I just renamed the parameter that someone else implemented, to cure a bug.

-- CrawfordCurrie - 16 Dec 2006

If we allow only redirect to Web.Topic instead of URL then there should be no security issue right? Then the cfg var could be use to unable URL redirect. In very much the same way as with %INCLUDE%.

-- StephaneLenclud - 16 Dec 2006

I think Stephane's assessment is right, therefore it is better to name the parameter redirectto (and add the web.topic support after the 4.1 release.)

-- PeterThoeny - 16 Dec 2006

OK, I renamed redirecturl to redirectto, in anticipation of supporting web.topic redirects (due to code freeze after 4.1 release).

To do for 4.2:

  • In save, support OtherTopic and Web.OtherTopic redirects, not depending on {AllowRedirectUrl} config flag
  • Pass redirectto parameter from edit to preview & save

This is tracked in Bugs:Item3310

-- PeterThoeny - 16 Dec 2006

Edit | Attach | Watch | Print version | History: r26 < r25 < r24 < r23 < r22 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r26 - 2006-12-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.