*** lib/TWiki/UI/Save.pm.orig 2005-09-15 11:57:18.000000000 +0200 --- lib/TWiki/UI/Save.pm 2005-09-15 12:32:29.000000000 +0200 *************** *** 177,184 **** } elsif ( $saveaction eq "quietsave" ) { $query->param( -name=>"dontnotify", -value=>"checked" ); } elsif ( $saveaction eq "cancel" ) { ! my $viewURL = TWiki::getScriptUrl( $webName, $topic, "view" ); ! TWiki::redirect( $query, "$viewURL?unlock=on" ); return; } elsif( $saveaction eq "preview" ) { TWiki::UI::Preview::preview( $webName, $topic, $userName, $query ); --- 177,195 ---- } elsif ( $saveaction eq "quietsave" ) { $query->param( -name=>"dontnotify", -value=>"checked" ); } elsif ( $saveaction eq "cancel" ) { ! # check that the page already exist before redirecting to it ! my $viewURL; ! if (&TWiki::Store::topicExists( $webName, $topic)) { ! $viewURL = TWiki::getScriptUrl($webName, $topic, "view") . "?unlock=on"; ! } elsif ($query->param('topicparent') && ! &TWiki::Store::topicExists($webName, $query->param('topicparent'))) { # else go to parent ! $viewURL = TWiki::getScriptUrl($webName, ! $query->param( 'topicparent' ), "view"); ! } else { # last resort: web home ! use vars qw( $mainTopicname ); ! $viewURL = TWiki::getScriptUrl($webName, $mainTopicname, "view"); ! } ! TWiki::redirect( $query, $viewURL ); return; } elsif( $saveaction eq "preview" ) { TWiki::UI::Preview::preview( $webName, $topic, $userName, $query );