[Jifty-commit] r1827 - in jifty/trunk: lib/Jifty lib/Jifty/Web

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Aug 18 19:44:41 EDT 2006


Author: jesse
Date: Fri Aug 18 19:44:41 2006
New Revision: 1827

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Notification.pm
   jifty/trunk/lib/Jifty/Test.pm
   jifty/trunk/lib/Jifty/Web/PageRegion.pm

Log:
 r20568 at pinglin:  jesse | 2006-08-18 19:44:22 -0400
 * undef != ''. These changes help quiet down some warnings exposed by BPS' internal app


Modified: jifty/trunk/lib/Jifty/Notification.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Notification.pm	(original)
+++ jifty/trunk/lib/Jifty/Notification.pm	Fri Aug 18 19:44:41 2006
@@ -249,7 +249,7 @@
 
 sub full_body {
   my $self = shift;
-  return join( "\n", $self->preface, $self->body, $self->footer );
+  return join( "\n", grep { defined } $self->preface, $self->body, $self->footer );
 }
 
 =head2 parts

Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Fri Aug 18 19:44:41 2006
@@ -170,7 +170,7 @@
 =cut
 
 sub setup_mailbox {
-    open my $f, ">", mailbox();
+    open my $f, ">:encoding(UTF-8)", mailbox();
     close $f;
 } 
 

Modified: jifty/trunk/lib/Jifty/Web/PageRegion.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/PageRegion.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/PageRegion.pm	Fri Aug 18 19:44:41 2006
@@ -191,13 +191,15 @@
 
     # Merge in the settings passed in via state variables
     for (Jifty->web->request->state_variables) {
-        if ($_->key =~ /^region-(.*?)\.(.*)/ and $1 eq $self->qualified_name and $_->value ne $self->default_argument($2)) {
-            $self->argument($2 => $_->value);
-            Jifty->web->set_variable("region-$1.$2" => $_->value);
+        my $key = $_->key;
+        my $value = $_->value || '';
+        if ($key =~ /^region-(.*?)\.(.*)/ and $1 eq $self->qualified_name and $value  ne $self->default_argument($2)) {
+            $self->argument($2 => $value);
+            Jifty->web->set_variable("region-$1.$2" => $value);
         }
-        if ($_->key =~ /^region-(.*?)$/ and $1 eq $self->qualified_name and $_->value ne $self->default_path) {
-            $self->path($_->value);
-            Jifty->web->set_variable("region-$1" => $_->value);
+        if ($key =~ /^region-(.*?)$/ and $1 eq $self->qualified_name and $value ne $self->default_path) {
+            $self->path($value);
+            Jifty->web->set_variable("region-$1" => $value);
         }
     }
 }


More information about the Jifty-commit mailing list