[Jifty-commit] r1606 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Jul 18 10:25:56 EDT 2006


Author: nelhage
Date: Tue Jul 18 10:25:55 2006
New Revision: 1606

Modified:
   jifty/trunk/lib/Jifty/Web.pm

Log:
J::Web::redirect can take a Clickable as arg, so make goto do that, instead of passing a URL with parameters, which doesn't work right

Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Tue Jul 18 10:25:55 2006
@@ -16,6 +16,7 @@
 use XML::Writer;
 use CSS::Squish;
 use Digest::MD5 qw(md5_hex);
+use Carp qw(carp);
 use base qw/Class::Accessor::Fast Class::Data::Inheritable Jifty::Object/;
 
 use vars qw/$SERIAL @JS_INCLUDES/;
@@ -537,7 +538,7 @@
     }
 }
 
-=head3 redirect [URL]
+=head3 redirect [TO]
 
 Redirect to the next page. If you pass this method a parameter, it
 redirects to that URL rather than B<next_page>.
@@ -554,7 +555,7 @@
     $page = Jifty::Web::Form::Clickable->new( url => $page )
       unless ref $page and $page->isa("Jifty::Web::Form::Clickable");
 
-    warn "Don't include GET paramters in the redirect URL -- use a Jifty::Web::Form::Clickable instead.  See L<Jifty::Web/redirect>" if $page->url =~ /\?/;
+    carp "Don't include GET paramters in the redirect URL -- use a Jifty::Web::Form::Clickable instead.  See L<Jifty::Web/redirect>" if $page->url =~ /\?/;
 
     my %overrides = ( @_ );
     $page->parameter($_ => $overrides{$_}) for keys %overrides;
@@ -693,7 +694,7 @@
 sub goto {
     my $self = shift;
     Jifty->web->redirect(
-        Jifty::Web::Form::Clickable->new(@_)->complete_url );
+        Jifty::Web::Form::Clickable->new(@_));
 }
 
 =head3 link PARAMHASH
@@ -750,7 +751,7 @@
 
     $self->render_error_messages($only_moniker);
     $self->render_success_messages($only_moniker);
-    
+
     return '';
 }
 


More information about the Jifty-commit mailing list