fix cf type record value setting
authorCornelius Weiß <c.weiss@metaways.de>
Tue, 20 Jun 2017 11:32:52 +0000 (13:32 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 22 Jun 2017 07:43:43 +0000 (09:43 +0200)
* use correnct recordClass
* set record instead of data only

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

index 74f8737..2c89943 100644 (file)
@@ -68,12 +68,8 @@ Tine.widgets.customfields.EditDialogPlugin.prototype = {
                 
                 if (field) {
                     if(field.isXType('combo') && Ext.isObject(this.customfieldsValue[name])) {
-                        var phpClassName = cfConfig.get('model').split('_Model_'),
-                            recordClass = Tine[phpClassName[0]].Model[phpClassName[1]],
-                            record = new recordClass(this.customfieldsValue[name]);
-                            
-                        field.setValue(record.getId());
-                        field.selectedRecord = record.data; 
+                        var record = new field.recordClass(this.customfieldsValue[name]);
+                        field.setValue(record);
                     } else {
                         field.setValue(this.customfieldsValue[name]);
                     }