Opened 8 years ago

Closed 7 years ago

#13937 closed defect (wontfix)

CouchDBRestStore - problem with non object views

Reported by: stsy Owned by: Jared Jurkiewicz
Priority: high Milestone:
Component: DojoX Data Version:
Keywords: Cc:
Blocked By: Blocking:

Description

CouchDBRestStore assumes that the value of all views is an object and tries to copy the id field and the loader into it. For simple views which contain for example only a string this dosen't work.

A hack fix would look as it follows:

Index: dojox/data/CouchDBRestStore.js
===================================================================
--- dojox/data/CouchDBRestStore.js	(Revision 26594)
+++ dojox/data/CouchDBRestStore.js	(Arbeitskopie)
@@ -46,6 +46,9 @@
 				var self = this;
 				for(var i = 0; i < rows.length;i++){
 					var realItem = rows[i].value;
+					if(typeof realItem != 'object'){
+						realItem = {'value':rows[i].value};
+					}
					realItem.__id= prefix + rows[i].id;
					realItem._id= rows[i].id;
 					realItem._loadObject= dojox.rpc.JsonRest._loader;

Change History (2)

comment:1 Changed 8 years ago by Jared Jurkiewicz

Have you filed a CLA? If not, then your suggested fix cannot be looked and and will be deleted from the ticket in the next week or so to avoid IP issues.

comment:2 Changed 7 years ago by Jared Jurkiewicz

Resolution: wontfix
Status: newclosed

No confirmation of CLA, therefore closing bug as wontfix.

Note: See TracTickets for help on using tickets.