Merge branch 'fibre' of ssh://git.onelab.eu/git/myslice into fibre
[unfold.git] / manifoldapi / static / js / manifold.js
index 31d4b00..01b48f5 100644 (file)
@@ -786,6 +786,7 @@ var manifold = {
             switch (this_type) {
                 case TYPE_VALUE:
                 case TYPE_LIST_OF_VALUES:
+                case TYPE_LIST_OF_RECORDS:
                     if (this_value != other_value)
                         return false;
                     break;
@@ -793,6 +794,9 @@ var manifold = {
                     if (!(_record_equals(this_value, other_value, key_fields)))
                         return false;
                     break;
+                /*
+                XXX WARNING = disabled for OpenFlow plugin !!!
+
                 case TYPE_LIST_OF_RECORDS:
                     if (this_value.length != other_value.length)
                         return false;
@@ -800,6 +804,7 @@ var manifold = {
                         if (!(_record_equals(this_value[j], other_value[j], key_fields)))
                             return false;
                     break;
+                */
             }
         }
         return true;
@@ -1111,6 +1116,9 @@ var manifold = {
          * otherwise, publish the main object as well as subqueries
          * XXX how much recursive are we ?
          */
+        if (records == null){
+            records = Array();
+        }
         if (manifold.pubsub_debug)
              messages.debug (">>>>> publish_result_rec " + query.object);
         if (manifold.query_expects_unique_result(query)) {
@@ -1224,6 +1232,11 @@ var manifold = {
         }
 
         key = manifold.metadata.get_key(new_object);
+        if (!key){
+            console.log("object type: " + new_object + " has no key");
+            console.log(record);
+            return;
+        }
         record.hashCode = manifold.record_hashcode(key.sort());
         record.equals   = manifold.record_equals(key);