• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.
I have a custom attachnew page for uploading a user picture. After uploading I want the user to return to the list of user pictures, not to the user page.

I have set redirectto but that (obviously?) fails. I also need to pass a custom template as url param: template=UserPictureView.

AC

I have updated Upload.pm with a piece of code from Save.pm. This function _getRedirectUrl could be better placed in a central place, and perhaps made accessible in Func.pm:

sub _getRedirectUrl {
    my $session = shift;

    my $query = $session->{cgiQuery};
    my $redirecturl = $query->param( 'redirectto' );
    return '' unless $redirecturl;
    if( $redirecturl =~ /^$TWiki::regex{linkProtocolPattern}\:\/\//o ) {
        # assuming URL
        if ($TWiki::cfg{AllowRedirectUrl}) {
            return $redirecturl;
        } else {
            return '';
        }
    }
    # assuming 'web.topic' or 'topic'
    my ( $w, $t ) = $session->normalizeWebTopicName( $session->{webName}, $redirecturl );
    $redirecturl = $session->getScriptUrl( 1, 'view', $w, $t );
}

AC

For Michael's objection to this redundant copying, see Item3580.

AC

ItemTemplate
Summary Make redirectto parameter work for upload
ReportedBy TWiki:Main.ArthurClemens
Codebase

SVN Range TWiki-4.1, Thu, 14 Dec 2006, build 12269
AppliesTo Engine
Component

Priority Enhancement
CurrentState Closed
WaitingFor

Checkins 12788 12789
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback