[Jifty-commit] jifty branch, master, updated. aa381496f5d89490c9f9f828e349a9c3c7af3490

Jifty commits jifty-commit at lists.jifty.org
Thu Jul 8 16:11:25 EDT 2010


The branch, master has been updated
       via  aa381496f5d89490c9f9f828e349a9c3c7af3490 (commit)
      from  4b42bec2cde45ede5d678b618898eee0b056d644 (commit)

Summary of changes:
 lib/Jifty/Web.pm |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit aa381496f5d89490c9f9f828e349a9c3c7af3490
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jul 8 16:12:18 2010 -0400

    DWIM when result message or error is an arrayref

diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index d254225..6dd94f1 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -1114,10 +1114,17 @@ sub _render_messages {
     $self->out(qq{<div class="jifty results messages" id="$plural">});
     
     foreach my $moniker ( sort keys %results ) {
-        if ( $results{$moniker}->$type() ) {
-            $self->out( qq{<div class="$type $moniker">}
-                        . $results{$moniker}->$type()
-                        . qq{</div>} );
+        if ( my $text = $results{$moniker}->$type() ) {
+            if ( ref $text eq 'ARRAY' ) {
+                $text = join '', @$text;
+            }
+            elsif ( ref $text ) {
+                $self->log->warn(
+                    ref($text) . " reference provided as result $type "
+                    . "for action $moniker (@{[$results{$moniker}->action_class]})"
+                );
+            }
+            $self->out( qq{<div class="$type $moniker">$text</div>} );
         }
     }
     $self->out(qq{</div>});

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list