see
TWiki:Codev.CreateCancelFail
currently testing this patch:
Index: UI/Save.pm
===================================================================
--- UI/Save.pm (revision 6384)
+++ UI/Save.pm (working copy)
@@ -397,8 +397,20 @@
if( $lease && $lease->{user}->equals( $user )) {
$store->clearLease( $webName, $topic );
}
- my $viewURL = $session->getScriptUrl( $webName, $topic, 'view' );
+
+ # redirect to a sensible place (a topic that exists)
+ my $viewURL;
+ # check that the page already exist before redirecting to it
+ if ( $store->topicExists( $webName, $topic ) ) {
+ $viewURL = $session->getScriptUrl( $webName, $topic, 'view' ) . '?unlock=on';
+ } elsif ( $query->param( 'topicparent' ) &&
+ $store->topicExists( $webName, $query->param('topicparent') ) ) { # go to parent
+ $viewURL = $session->getScriptUrl( $webName, $query->param( 'topicparent' ), 'view' );
+ } else { # last resort: web home
+ $viewURL = $session->getScriptUrl( $webName, $TWiki::cfg{HomeTopicName}, 'view' );
+ }
$session->redirect( $viewURL );
+
return;
} elsif( $saveaction =~ /^(del|rep)Rev$/ ) {
SVN:6389, but i still have questions about how
topicparent
could have ever worked... at least code is better than what was there before, whereby you could be redirected to a topic that doesn't exist. --
WN
after a discussion with colas on
TWiki:Codev.TWikiIRC, we determined that that
topicparent
case doesn't work because the
Cancel
"button" isn't a submit button (which would send all of the form data), but instead a simple link. so,
Cancel
needs to be converted into a proper button. --
WN
ok, this
code is fine; however,
Cancel
buttons need to be made into proper buttons. see
Item395 --
WN