diff options
author | ivan <ivan> | 2010-08-04 01:22:34 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-08-04 01:22:34 +0000 |
commit | 6dcc4e277f46157a3df6c5d0b7ebde0fb848bb0b (patch) | |
tree | 99603af66ca7b4bb1b7c0814d5117d9003758483 /FS | |
parent | f07fc98b146cdaa5861d766cc7c84ea0136f38ec (diff) |
better serialization on debugging data, RT#7514
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_export/communigate_pro.pm | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index 76fd60815..a3847bf2e 100644 --- a/FS/FS/part_export/communigate_pro.pm +++ b/FS/FS/part_export/communigate_pro.pm @@ -823,17 +823,7 @@ sub export_getsettings_svc_acct { 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 export_getsettings_svc_acct { } +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 ) = @_; |