diff --git a/core/modules/tiddler.js b/core/modules/tiddler.js index e58d4ddf9..b0b6e6942 100644 --- a/core/modules/tiddler.js +++ b/core/modules/tiddler.js @@ -24,13 +24,13 @@ exports.isDraft = function() { return this.hasField("draft.of"); }; -exports.getFieldString = function(field) { +exports.getFieldString = function(field,defaultValue) { var value = this.fields[field]; // Check for a missing field if(value === undefined || value === null) { - return ""; + return defaultValue || ""; } - // Parse the field with the associated module (if any) + // Stringify the field with the associated tiddler field module (if any) var fieldModule = $tw.Tiddler.fieldModules[field]; if(fieldModule && fieldModule.stringify) { return fieldModule.stringify.call(this,value); diff --git a/core/modules/widgets/radio.js b/core/modules/widgets/radio.js index 22c9d8614..363836227 100644 --- a/core/modules/widgets/radio.js +++ b/core/modules/widgets/radio.js @@ -64,9 +64,9 @@ RadioWidget.prototype.getValue = function() { tiddler = this.wiki.getTiddler(this.radioTitle); if(tiddler) { if(this.radioIndex) { - value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex); + value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex,this.radioDefault); } else { - value = tiddler.getFieldString(this.radioField); + value = tiddler.getFieldString(this.radioField,this.radioDefault); } } else { value = this.radioDefault;