X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FXMLRPC.pm;h=73ce13f7a1c17d4bb0eb80870d35cad56c739496;hp=fb0e5ac74ada7a7a207bd15193c3923637611dc3;hb=90393980e5f2859ee1e186fa461f48f5129e803e;hpb=40a7b3dc653e099f7bd0bd762b649b04c4432db2 diff --git a/FS/FS/XMLRPC.pm b/FS/FS/XMLRPC.pm index fb0e5ac74..73ce13f7a 100644 --- a/FS/FS/XMLRPC.pm +++ b/FS/FS/XMLRPC.pm @@ -1,7 +1,7 @@ -package FS::XMLRPC; + package FS::XMLRPC; use strict; -use vars qw( @ISA $DEBUG ); +use vars qw( $DEBUG ); use Frontier::RPC2; # Instead of 'use'ing freeside modules on the fly below, just preload them now. @@ -11,9 +11,9 @@ use FS::Conf; use FS::Record; use FS::cust_main; -use Data::Dumper; +use FS::Maestro; -@ISA = qw( ); +use Data::Dumper; $DEBUG = 0; @@ -131,9 +131,9 @@ sub _serve { #Subroutine, not method } - warn Dumper(@result) if $DEBUG; - - if (grep { UNIVERSAL::can($_, 'hashref') ? 0 : 1 } @result) { + if ( scalar(@result) == 1 && ref($result[0]) eq 'HASH' ) { + return $result[0]; + } elsif (grep { UNIVERSAL::can($_, 'hashref') ? 0 : 1 } @result) { #warn "FS::XMLRPC: One or more objects returned from '${fssub}' doesn't " . # "support the 'hashref' method."; @@ -147,8 +147,8 @@ sub _serve { #Subroutine, not method return [ $FS::VERSION ]; } # else... - warn "Unhandle XMLRPC request '${method_name}'"; - return []; + warn "Unhandled XMLRPC request '${method_name}'"; + return {}; }