Fix logic glitch for attribute maps for initial database creation. gloda-milestone-1
authorAndrew Sutherland <asutherland@asutherland.org>
Sun, 06 Jul 2008 21:35:51 -0700
changeset 833 4b665f55dc96f043ac129be3f1c886546b5b9e6d
parent 832 45029a6efd9cef41f2f15a84ac28f85db69ac974
child 834 cb593cb6c3e57a01ac066c50362b37f8bdb2c2fc
push idunknown
push userunknown
push dateunknown
Fix logic glitch for attribute maps for initial database creation.
modules/gloda.js
--- a/modules/gloda.js
+++ b/modules/gloda.js
@@ -200,25 +200,26 @@ let Gloda = {
     
     // Being here means the attribute def does not exist in the database.
     // Of course, we only want to create something in the database if the
     //  parameter is forever un-bound (type is null).
     let attrID = null;
     if (aParameterType == null) {
       attrID = GlodaDatastore._createAttributeDef(aAttrType, aPluginName,
                                                   aAttrName, null);
-      GlodaDatastore._attributeIDToDef[attrID] = [attrID, null];
     }
     
     attr = new GlodaAttributeDef(GlodaDatastore, attrID, compoundName,
                                  aProvider, aAttrType, aPluginName, aAttrName,
                                  aSubjectType, aObjectType, aParameterType,
                                  aExplanationFormat);
     GlodaDatastore._attributes[compoundName] = attr;
     this._attrProviders[aProvider].push(attr);
+    if (aParameterType == null)    
+      GlodaDatastore._attributeIDToDef[attrID] = [attr, null];
     return attr;
   },
   
   getAttrDef: function gloda_ns_getAttrDef(aPluginName, aAttrName) {
     let compoundName = aPluginName + ":" + aAttrName;
     return GlodaDatastore._attributes[compoundName];
   },