Redirect URI after discard - is there such a thing?

Author Message

Piotrek Karaś

Saturday 14 April 2007 5:39:24 am

I need to have control over what happens when 'Publish' or 'Discard' form buttons are pressed in the public interface /content/edit scenario. The 'Publish' one is obvious: I pass additional variable 'RedirectURIAfterPublish'. Unfortunately, I see no similar functionality to control redirection when the draft is discarded. Does anyone have an idea how to deal with it? Thanks.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Sébastien Morel

Saturday 14 April 2007 6:49:19 am

Hello,

I think "RedirectIfDiscarded" works...

plop+

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Piotrek Karaś

Saturday 14 April 2007 12:53:20 pm

I had been looking a 'RedirectURI*' string in the kernel classes, didn't expect it to be named following different pattern :)
And RedirectIfDiscarded is there. Unfortunately, it doesn't seem to work... Here's my code:

<form method="post" action={'content/action'|ezurl()}>
  <input type="hidden" name="ClassIdentifier" value="my_answer_class" />
  <input type="hidden" name="NodeID" value="{$answer.node_id}" />
  <input type="hidden" name="RedirectURIAfterPublish" value="{$node.url_alias}" />
  <input type="hidden" name="RedirectIfDiscarded" value="{$node.url_alias}" />
  <input type="submit" name="NewButton" value="REPLY" />
</form>

While redirection after publishing works fine, the other one doesn't (works just as if there was no RedirectIfDiscarded variable). Any suggestions?
By the way, it is version 3.9.1.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Heath

Saturday 14 April 2007 1:28:25 pm

Hello Piotr,

I use this on a production site to control redirection for content/edit after submission. The hidden input, 'RedirectIfDiscarded' redirects my users to the last uri accessed (before content/edit) after discarding the draft.

<input type="hidden" name="DiscardConfirm" value="0" />
<input type="hidden" name="RedirectIfDiscarded" value={ezhttp('LastAccessesURI','session')} />

hth,

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Piotrek Karaś

Saturday 14 April 2007 3:25:04 pm

Hi,

Thank you for the tip - it does work as expected so my problem is solved.

I did some testing, though. There seem to be two locations where redirect instruction may be placed: the initial 'do some action' form and the actual act (edit) form. While RedirectURIAfterPublish variable works fine in both, RedirectIfDiscarded doesn't seem to give any effect when placed in the initial form. That would mean we cannot precisely control what happens in case we discard a draft, we can only get back to the original or some generic location. It may be convenient enough, we'll see :)

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Heath

Saturday 14 April 2007 3:48:26 pm

The tags in my first message were added to the file custom template override, 'design/ezwebin_user_site/templates/content/edit_attribute_user.tpl'

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Piotrek Karaś

Sunday 15 April 2007 12:09:16 am

@Heath: Yes, that seems to be the actual edit form template. Well, one step ahead :) Thanks!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.