]> 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:51 +0000 (16:09 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 23 Feb 2010 00:09:51 +0000 (16:09 -0800)
to JSON, so that the Bug.get "internals" return item works.
r=dkl, a=mkanat

Bugzilla/Object.pm

index 0bb865ea60b3627d69302f3f7628472ef454b837..27098806e5509742302082ce8ba10856e69000e4 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     ####
 ###############################