[Jifty-commit] r5928 - jifty/trunk/lib/Jifty/Param

Jifty commits jifty-commit at lists.jifty.org
Sun Oct 12 13:53:27 EDT 2008


Author: clkao
Date: Sun Oct 12 13:53:26 2008
New Revision: 5928

Modified:
   jifty/trunk/lib/Jifty/Param/Schema.pm

Log:
Fix the kludgy merge_param to rebless back the merged hash as well
as the hashes passed for merging.


Modified: jifty/trunk/lib/Jifty/Param/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Param/Schema.pm	(original)
+++ jifty/trunk/lib/Jifty/Param/Schema.pm	Sun Oct 12 13:53:26 2008
@@ -179,11 +179,13 @@
     # objects and hahrefs with no complaint, but 0.10 doesn't.  This
     # is a horrible, horrible hack, and will hopeflly be able to be
     # backed out if and when Hash::Merge reverts to the old behavior.
+    my $field_type = {};
     my @types;
     for my $m (@_) {
         my @t;
         for (keys %{$m}) {
             push @t, ref $m->{$_};
+            $field_type->{$_} = ref $m->{$_};
             bless $m->{$_}, "HASH";
         }
         push @types, \@t;
@@ -198,6 +200,11 @@
             bless $m->{$_}, shift @t;
         }
     }
+
+    for ( keys %$rv ) {
+        bless $rv->{$_}, $field_type->{$_}
+            if $field_type->{$_};
+    }
     return $rv;
 }
 


More information about the Jifty-commit mailing list