Skip to content

Commit

Permalink
Fix EZP-23478: unexpected legacy red. after publish
Browse files Browse the repository at this point in the history
When editing content from a new stack frontoffice, with edit screen handled in a legacy fallback, redirection after publish will be done to the last visited legacy uri, not to the edited content as we could expect.

This fix adds explicit post fields to the ezdemo edit templates, so that explicit redirection uris can be passed to the form. The RedirectURIAfterPublish and RedirectIfDiscarded POST variables can be sent to content/action and content/edit. They will be saved to the session, and added to the form.
  • Loading branch information
Bertrand Dunogier committed Nov 26, 2014
1 parent 7047ec2 commit 2131212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -134,8 +134,8 @@
<input class="button" type="submit" name="StoreButton" value="{'Store draft'|i18n( 'design/ezflow/edit/frontpage' )}" />
<input class="button" type="submit" name="DiscardButton" value="{'Discard draft'|i18n( 'design/ezflow/edit/frontpage' )}" />
<input type="hidden" name="DiscardConfirm" value="0" />
<input type="hidden" name="RedirectIfDiscarded" value="{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}{ezhttp( 'LastAccessesURI', 'session' )}{/if}" />
<input type="hidden" name="RedirectURIAfterPublish" value="{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}{ezhttp( 'LastAccessesURI', 'session' )}{/if}" />
{include uri="design:content/edit_redirection.tpl"}
</div>
</div>
Expand Down
Expand Up @@ -71,9 +71,11 @@
<input class="button" type="submit" name="StoreExitButton" value="{'Store draft and exit'|i18n( 'design/ezdemo/content/edit' )}" title="{'Store the draft that is being edited and exit from edit mode. Use when you need to exit your work and return later to continue.'|i18n( 'design/ezdemo/content/edit' )}" />
<input class="button" type="submit" name="DiscardButton" value="{'Discard draft'|i18n( 'design/ezdemo/content/edit' )}" title="{'Discard the draft that is being edited. This will also remove the translations that belong to the draft (if any).'|i18n( 'design/ezdemo/content/edit' ) }" />
<input type="hidden" name="DiscardConfirm" value="0" />
<input type="hidden" name="RedirectIfDiscarded" value="{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}{ezhttp( 'LastAccessesURI', 'session' )}{/if}" />
<input type="hidden" name="RedirectURIAfterPublish" value="{if ezhttp_hasvariable( 'LastAccessesURI', 'session' )}{ezhttp( 'LastAccessesURI', 'session' )}{/if}" />

{include uri='design:content/edit_redirection.tpl'}

</div>

</div>

</form>

0 comments on commit 2131212

Please sign in to comment.