0010834: defining a key-value costumfield breaks addressbook
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 17 Feb 2015 12:45:33 +0000 (13:45 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 18 Feb 2015 16:35:02 +0000 (17:35 +0100)
* use set() to update config item in registry
* trying to set the object directly did not work any longer (did it ever
work?)

https://forge.tine20.org/view.php?id=10834

Change-Id: If9e0325648cdbe3c372e878d1b365d226291c8aa
Reviewed-on: http://gerrit.tine20.com/customers/1670
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/js/widgets/customfields/ConfigManager.js

index 5b05752..d8ef207 100644 (file)
@@ -20,14 +20,17 @@ Tine.widgets.customfields.ConfigManager = function() {
                 data: allCfs ? allCfs : []
             });
             
-            // place keyFieldConfig in registry so we can use the standard widgets
+            // place customefield keyFieldConfig in registry so we can use the standard widgets
+            // keyfields are used for key/value customfields with a defined store 
             stores[app.appName].each(function(cfConfig) {
                 var definition = cfConfig.get('definition'),
                     options = definition.options ? definition.options : {},
                     keyFieldConfig = definition.keyFieldConfig ? definition.keyFieldConfig : null;
                     
                 if (keyFieldConfig) {
-                    app.getRegistry().get('config')[cfConfig.get('name')] = keyFieldConfig;
+                    var config = app.getRegistry().get('config');
+                    config[cfConfig.get('name')] = keyFieldConfig;
+                    app.getRegistry().set('config', config);
                 }
             });
         }