From bbfc7014301e80090bf60082cbb11bc2a4e3ed7f Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Thu, 28 Nov 2013 15:19:48 +0100
Subject: [PATCH] ugly hack to use hrn instead of urn for now

---
 plugins/googlemap/static/js/googlemap.js   | 9 +++++++++
 plugins/querytable/static/js/querytable.js | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js
index 0a71a435..b8bbf538 100644
--- a/plugins/googlemap/static/js/googlemap.js
+++ b/plugins/googlemap/static/js/googlemap.js
@@ -44,6 +44,15 @@ googlemap_debug_detailed=false;
 	    // 
             this.key = (keys && keys.length == 1) ? keys[0] : null;
 
+	    // xxx temporary hack
+	    // as of nov. 28 2013 we have here this.key='urn', but in any place where
+	    // the code tries to access record[this.key] the records only have
+	    // keys=type,hrn,network_hrn,hostname
+	    // so for now we force using hrn instead
+	    // as soon as record have their primary key set this line can be removed
+	    // see also same hack in querytable
+	    this.key= (this.key == 'urn') ? 'hrn' : this.key;
+
             //// Setup query and record handlers 
 	    // this query is the one about the slice itself 
 	    // event related to this query will trigger callbacks like on_new_record
diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js
index 4cafe83e..12232c8e 100644
--- a/plugins/querytable/static/js/querytable.js
+++ b/plugins/querytable/static/js/querytable.js
@@ -44,6 +44,15 @@
             var keys = manifold.metadata.get_key(this.method);
             this.key = (keys && keys.length == 1) ? keys[0] : null;
 
+	    // xxx temporary hack
+	    // as of nov. 28 2013 we have here this.key='urn', but in any place where
+	    // the code tries to access record[this.key] the records only have
+	    // keys=type,hrn,network_hrn,hostname
+	    // so for now we force using hrn instead
+	    // as soon as record have their primary key set this line can be removed
+	    // see also same hack in googlemap
+	    this.key= (this.key == 'urn') ? 'hrn' : this.key;
+
             /* Setup query and record handlers */
             this.listen_query(options.query_uuid);
             this.listen_query(options.query_all_uuid, 'all');
-- 
2.47.0