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.

eZ debug

Timing: Jan 18 2025 19:12:59
Script start
Timing: Jan 18 2025 19:12:59
Module start 'layout'
Timing: Jan 18 2025 19:12:59
Module start 'content'
Timing: Jan 18 2025 19:12:59
Module end 'content'
Timing: Jan 18 2025 19:12:59
Script end

Main resources:

Total runtime0.0243 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.1719152.6406
Module start 'layout' 0.00510.0039 741.812539.4766
Module start 'content' 0.00900.0130 781.2891101.4609
Module end 'content' 0.02200.0022 882.750042.3047
Script end 0.0242  925.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.7914140.0002
Check MTime0.00124.8051140.0001
Mysql Total
Database connection0.00073.055510.0007
Mysqli_queries0.003012.423230.0010
Looping result0.00000.135510.0000
Template Total0.00176.810.0017
Template load0.00093.590610.0009
Template processing0.00083.232210.0008
Override
Cache load0.00062.470310.0006
General
dbfile0.00031.171380.0000
String conversion0.00000.031440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs