Index: design/admin/templates/content/create_languages.tpl
===================================================================
--- design/admin/templates/content/create_languages.tpl	(revision 22479)
+++ design/admin/templates/content/create_languages.tpl	(working copy)
@@ -57,6 +57,9 @@
 {if $redirect_uri_after_publish}
     <input type="hidden" name="RedirectURIAfterPublish" value="{$redirect_uri_after_publish|wash}" />
 {/if}
+{if $redirect_uri_after_discard}
+    <input type="hidden" name="RedirectIfDiscarded" value="{$redirect_uri_after_discard|wash}" />
+{/if}
 
 <input type="hidden" name="CancelURI" value="content/view/full/{$node_id|wash}" />
 
Index: design/standard/templates/content/create_languages.tpl
===================================================================
--- design/standard/templates/content/create_languages.tpl	(revision 22479)
+++ design/standard/templates/content/create_languages.tpl	(working copy)
@@ -48,6 +48,9 @@
 {if $redirect_uri_after_publish}
     <input type="hidden" name="RedirectURIAfterPublish" value="{$redirect_uri_after_publish|wash}" />
 {/if}
+{if $redirect_uri_after_discard}
+    <input type="hidden" name="RedirectIfDiscarded" value="{$redirect_uri_after_discard|wash}" />
+{/if}
 <input type="hidden" name="CancelURI" value="content/view/full/{$node_id|wash}" />
 
 <div class="block">
Index: kernel/content/action.php
===================================================================
--- kernel/content/action.php	(revision 22479)
+++ kernel/content/action.php	(working copy)
@@ -132,8 +132,9 @@
 
             $tpl->setVariable( 'node_id', $http->postVariable( 'NodeID' ) );
             $tpl->setVariable( 'class_id', $contentClassID );
-            $tpl->setVariable( 'assignment_remote_id', ( $http->hasPostVariable( 'AssignmentRemoteID' ) )? $http->postVariable( 'AssignmentRemoteID' ): false );
-            $tpl->setVariable( 'redirect_uri_after_publish', ( $http->hasPostVariable( 'RedirectURIAfterPublish' ) )? $http->postVariable( 'RedirectURIAfterPublish' ): false );
+            $tpl->setVariable( 'assignment_remote_id', $http->postVariable( 'AssignmentRemoteID', false ) );
+            $tpl->setVariable( 'redirect_uri_after_publish', $http->postVariable( 'RedirectURIAfterPublish', false ) );
+            $tpl->setVariable( 'redirect_uri_after_discard', $http->postVariable( 'RedirectIfDiscarded', false ) );
 
             $Result = array();
             $Result['content'] = $tpl->fetch( 'design:content/create_languages.tpl' );
@@ -160,14 +161,17 @@
             $contentObject = eZContentObject::createWithNodeAssignment( $node,
                                                                         $contentClassID,
                                                                         $languageCode,
-                                                                        ( $http->hasPostVariable( 'AssignmentRemoteID' ) ?
-                                                                              $http->postVariable( 'AssignmentRemoteID' ) : false ) );
+                                                                        $http->postVariable( 'AssignmentRemoteID', false ) );
             if ( $contentObject )
             {
                 if ( $http->hasPostVariable( 'RedirectURIAfterPublish' ) )
                 {
                     $http->setSessionVariable( 'RedirectURIAfterPublish', $http->postVariable( 'RedirectURIAfterPublish' ) );
                 }
+                if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
+                {
+                    $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
+                }
                 $module->redirectTo( $module->functionURI( 'edit' ) . '/' . $contentObject->attribute( 'id' ) . '/' . $contentObject->attribute( 'current_version' ) );
                 return;
             }
@@ -1020,6 +1024,10 @@
         {
             $http->setSessionVariable( 'RedirectURIAfterPublish', $http->postVariable( 'RedirectURIAfterPublish' ) );
         }
+        if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
+        {
+            $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
+        }
 
         $module->redirectToView( 'edit', $parameters );
         return;
@@ -1044,17 +1052,10 @@
 }
 else if ( $http->hasPostVariable( 'RemoveButton' ) )
 {
-    if ( $http->hasPostVariable( 'ViewMode' ) )
-        $viewMode = $http->postVariable( 'ViewMode' );
-    else
-        $viewMode = 'full';
+    $viewMode = $http->postVariable( 'ViewMode', 'full' );
 
-    $contentNodeID = 2;
-    if ( $http->hasPostVariable( 'ContentNodeID' ) )
-        $contentNodeID = $http->postVariable( 'ContentNodeID' );
-    $contentObjectID = 1;
-    if ( $http->hasPostVariable( 'ContentObjectID' ) )
-        $contentObjectID = $http->postVariable( 'ContentObjectID' );
+    $contentNodeID = $http->postVariable( 'ContentNodeID', 2 );
+    $contentObjectID = $http->postVariable( 'ContentObjectID', 1 );
 
     $hideRemoveConfirm = false;
     if ( $http->hasPostVariable( 'HideRemoveConfirmation' ) )
@@ -1108,17 +1109,10 @@
 else if ( $http->hasPostVariable( 'MoveButton' ) )
 {
     /* action for multi select move, uses same interface as RemoveButton */
-    if ( $http->hasPostVariable( 'ViewMode' ) )
-        $viewMode = $http->postVariable( 'ViewMode' );
-    else
-        $viewMode = 'full';
+    $viewMode = $http->postVariable( 'ViewMode', 'full' );
 
-    $parentNodeID = 2;
-    if ( $http->hasPostVariable( 'ContentNodeID' ) )
-        $parentNodeID = $http->postVariable( 'ContentNodeID' );
-    $parentObjectID = 1;
-    if ( $http->hasPostVariable( 'ContentObjectID' ) )
-        $parentObjectID = $http->postVariable( 'ContentObjectID' );
+    $parentNodeID = $http->postVariable( 'ContentNodeID', 2 );
+    $parentObjectID = $http->postVariable( 'ContentObjectID', 1 );
 
     if ( $http->hasPostVariable( 'DeleteIDArray' ) or $http->hasPostVariable( 'SelectedIDArray' ) )
     {
@@ -1225,15 +1219,7 @@
 }
 else if ( $http->hasPostVariable( 'UpdatePriorityButton' ) )
 {
-    //include_once( 'kernel/classes/ezcontentcache.php' );
-    if ( $http->hasPostVariable( 'ViewMode' ) )
-    {
-        $viewMode = $http->postVariable( 'ViewMode' );
-    }
-    else
-    {
-        $viewMode = 'full';
-    }
+    $viewMode = $http->postVariable( 'ViewMode', 'full' );
 
     if ( $http->hasPostVariable( 'ContentNodeID' ) )
     {
@@ -1294,14 +1280,9 @@
         $contentINI = eZINI::instance( 'content.ini' );
         $nodeID = $contentINI->variable( 'NodeSettings', 'RootNode' );
     }
-    if ( $http->hasPostVariable( 'ViewMode' ) )
-    {
-        $viewMode = $http->postVariable( 'ViewMode' );
-    }
-    else
-    {
-        $viewMode = 'full';
-    }
+
+    $viewMode = $http->postVariable( 'ViewMode', 'full' );
+
     $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $nodeID . '/' );
     return;
 }
@@ -1354,14 +1335,8 @@
     }
     else if ( $http->hasPostVariable( "ActionRemove" ) )
     {
-        if ( $http->hasPostVariable( 'ViewMode' ) )
-        {
-            $viewMode = $http->postVariable( 'ViewMode' );
-        }
-        else
-        {
-            $viewMode = 'full';
-        }
+        $viewMode = $http->postVariable( 'ViewMode', 'full' );
+
         $parentNodeID = 2;
         $contentNodeID = null;
         if ( $http->hasPostVariable( 'ContentNodeID' ) and is_numeric( $http->postVariable( 'ContentNodeID' ) ) )
@@ -1370,10 +1345,9 @@
             $node = eZContentObjectTreeNode::fetch( $contentNodeID );
             $parentNodeID = $node->attribute( 'parent_node_id' );
         }
-        $contentObjectID = 1;
-        if ( $http->hasPostVariable( 'ContentObjectID' ) )
-            $contentObjectID = $http->postVariable( 'ContentObjectID' );
 
+        $contentObjectID = $http->postVariable( 'ContentObjectID', 1 );
+
         $hideRemoveConfirm = false;
         if ( $http->hasPostVariable( 'HideRemoveConfirmation' ) )
             $hideRemoveConfirm = $http->postVariable( 'HideRemoveConfirmation' ) ? true : false;
Index: kernel/content/edit.php
===================================================================
--- kernel/content/edit.php	(revision 22479)
+++ kernel/content/edit.php	(working copy)
@@ -97,6 +97,10 @@
 {
     $http->setSessionVariable( 'RedirectURIAfterPublish', $http->postVariable( 'RedirectURIAfterPublish' ) );
 }
+if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
+{
+    $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
+}
 
 // Action for edit_draft.tpl page,
 // EditButton is the button for editing the selected version.
@@ -581,8 +585,6 @@
             $discardConfirm = true;
             if ( $http->hasPostVariable( 'DiscardConfirm' ) )
                 $discardConfirm = $http->postVariable( 'DiscardConfirm' );
-            if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
-                $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
             $http->setSessionVariable( 'DiscardObjectID', $objectID );
             $http->setSessionVariable( 'DiscardObjectVersion', $EditVersion );
             $http->setSessionVariable( 'DiscardObjectLanguage', $EditLanguage );
@@ -599,6 +601,11 @@
 
             $node = $object->mainNode();
 
+            if ( $http->hasSessionVariable( 'RedirectIfDiscarded' ) )
+            {
+                $http->removeSessionVariable( 'RedirectIfDiscarded' );
+            }
+
             $hasRedirected = false;
             if ( $http->hasSessionVariable( 'ParentObject' ) && $http->sessionVariable( 'NewObjectID' ) == $object->attribute( 'id' ) )
             {
@@ -627,7 +634,7 @@
                 $module->redirectTo( $uri );
                 $hasRedirected = true;
             }
-            if ( $http->hasPostVariable( "BackToEdit") && $http->postVariable( "BackToEdit") )
+            if ( $http->hasPostVariable( "BackToEdit" ) && $http->postVariable( "BackToEdit" ) )
             {
                 $uri = $module->redirectionURI( 'content', 'edit', array( $object->attribute( 'id'), 'f', $EditLanguage ) );
                 $module->redirectTo( $uri );
