util.pubsub: get_items(): When requesting a specific item, use the id as a key to mirror the multiple-item case

Wed, 22 Dec 2010 02:13:26 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 22 Dec 2010 02:13:26 +0000
changeset 3931
6daed692264f
parent 3930
46d9cf613bb1
child 3932
aa245e43b21e

util.pubsub: get_items(): When requesting a specific item, use the id as a key to mirror the multiple-item case

util/pubsub.lua file | annotate | diff | comparison | revisions
--- a/util/pubsub.lua	Tue Dec 21 22:26:22 2010 +0000
+++ b/util/pubsub.lua	Wed Dec 22 02:13:26 2010 +0000
@@ -227,7 +227,7 @@
 		return false, "item-not-found";
 	end
 	if id then -- Restrict results to a single specific item
-		return true, { node_obj.data[id] };
+		return true, { [id] = node_obj.data[id] };
 	else
 		return true, node_obj.data;
 	end

mercurial