[Jifty-commit] r4110 - jifty/trunk/lib/Jifty/Web
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Thu Sep 13 16:24:14 EDT 2007
Author: clkao
Date: Thu Sep 13 16:24:14 2007
New Revision: 4110
Modified:
jifty/trunk/lib/Jifty/Web/PageRegion.pm
Log:
Handle region redirect with continuation return (for spa).
Modified: jifty/trunk/lib/Jifty/Web/PageRegion.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/PageRegion.pm (original)
+++ jifty/trunk/lib/Jifty/Web/PageRegion.pm Thu Sep 13 16:24:14 2007
@@ -310,13 +310,14 @@
$subrequest->path( $self->path );
$subrequest->top_request( Jifty->web->request->top_request );
+ my %args;
if ($self->path =~ m/\?/) {
# XXX: this only happens if we are redirect within region AND
# with continuation, which is already taken care of by the
# clone.
my ($path, $arg) = split(/\?/, $self->path, 2);
$subrequest->path( $path );
- my %args = (map { split /=/, $_ } split /&/, $arg);
+ %args = (map { split /=/, $_ } split /&/, $arg);
if ($args{'J:C'}) {
$subrequest->continuation($args{'J:C'});
}
@@ -327,6 +328,14 @@
}
# $subrequest->clear_actions;
local Jifty->web->{request} = $subrequest;
+ if ($args{'J:RETURN'}) {
+ my $top = Jifty->web->request->top_request;
+ warn "===> $top";
+ my $cont = Jifty->web->session->get_continuation($args{'J:RETURN'});
+ $cont->return;
+ # need to set this as subrequest again as it's clobbered by the return
+ Jifty->web->request->top_request($top);
+ }
# While we're inside this region, have Mason to tack its response
# onto a variable and not send headers when it does so
More information about the Jifty-commit
mailing list