[freeside-commits] freeside/FS/FS/part_export communigate_pro.pm, 1.36, 1.37

Ivan,,, ivan at wavetail.420.am
Tue Aug 3 18:22:36 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv18244

Modified Files:
	communigate_pro.pm 
Log Message:
better serialization on debugging data, RT#7514

Index: communigate_pro.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/communigate_pro.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -w -d -r1.36 -r1.37
--- communigate_pro.pm	4 Aug 2010 01:15:52 -0000	1.36
+++ communigate_pro.pm	4 Aug 2010 01:22:34 -0000	1.37
@@ -823,17 +823,7 @@
   foreach my $key ( grep ref($effective_settings->{$_}),
                     keys %$effective_settings )
   {
-    my $value = $effective_settings->{$key};
-    if ( ref($value) eq 'ARRAY' ) {
-      $effective_settings->{$key} =
-        join(' ', map { ref($_) ? '['.join(', ', @$_).']' : $_ } @$value );
-    } elsif ( ref($value) eq 'HASH' ) {
-      $effective_settings->{$key} =
-        join(', ', map { "$_:".$value->{$_} } keys %$value );
-    } else {
-      #XXX
-      warn "serializing ". ref($value). " for table display not yet handled";
-    }
+    $effective_settings->{$key} = _pretty( $effective_settings->{$key} );
   }
 
   %{$settingsref} = %$effective_settings;
@@ -843,6 +833,22 @@
 
 }
 
+sub _pretty {
+  my $value = shift;
+  if ( ref($value) eq 'ARRAY' ) {
+    '['. join(' ', map { ref($_) ? _pretty($_) : $_ } @$value ). ']';
+  } elsif ( ref($value) eq 'HASH' ) {
+    my $hv = $value->{$_};
+    join(', ', map { my $v = $value->{$_};
+                     "$_:". ref($v) ? _pretty($v) : $_ 
+                   }
+                   keys %$value
+        );
+  } else {
+    warn "serializing ". ref($value). " for table display not yet handled";
+  }
+}
+
 sub export_getsettings_svc_forward {
   my($self, $svc_forward, $settingsref, $defaultref ) = @_;
 



More information about the freeside-commits mailing list