]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 486074: Allow the JSON-RPC interface to properly serialize objects
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 23 Feb 2010 00:09:08 +0000 (16:09 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 23 Feb 2010 00:09:08 +0000 (16:09 -0800)
to JSON, so that the Bug.get "internals" return item works.
r=dkl, a=mkanat

Bugzilla/Object.pm

index 11db7567bb46db7e67bfe909b5de95e5ea476b4b..a54cf7caa4d9585453877fc9fa45ffa83a074119 100644 (file)
@@ -38,6 +38,11 @@ use constant UPDATE_VALIDATORS => {};
 use constant NUMERIC_COLUMNS   => ();
 use constant DATE_COLUMNS      => ();
 
+# This allows the JSON-RPC interface to return Bugzilla::Object instances
+# as though they were hashes. In the future, this may be modified to return
+# less information.
+sub TO_JSON { return { %{ $_[0] } }; }
+
 ###############################
 ####    Initialization     ####
 ###############################