diff --git a/core/modules/widgets/data.js b/core/modules/widgets/data.js index c3da00919..5d76f5abd 100644 --- a/core/modules/widgets/data.js +++ b/core/modules/widgets/data.js @@ -123,7 +123,6 @@ DataWidget.prototype.computeDataTiddlerValues = function() { } } else { // Apply the item fields to each of the tiddlers - delete item.title; // Do not overwrite the title if(Object.keys(item).length > 0) { $tw.utils.each(tiddlers,function(tiddler,index) { tiddlers[index] = new $tw.Tiddler(tiddler,item); diff --git a/editions/test/tiddlers/tests/data/data-widget/ImportCustomTitle.tid b/editions/test/tiddlers/tests/data/data-widget/ImportCustomTitle.tid new file mode 100644 index 000000000..34029ae32 --- /dev/null +++ b/editions/test/tiddlers/tests/data/data-widget/ImportCustomTitle.tid @@ -0,0 +1,23 @@ +title: Data/ImportCustomTitle +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] +description: Importing a payload tiddler and overwriting the title + +title: Description +text: Importing a payload tiddler and overwriting the title ++ +title: Output + +\whitespace trim +<$testcase template="$:/core/ui/testcases/RawJSONTemplate"> +<$data $tiddler="HelloThere" title="RealTitle"/> +$testcase> ++ +title: HelloThere +tags: Definitions + +This is the tiddler HelloThere ++ +title: ExpectedResult + +
[ + { + "title": "RealTitle", + "tags": "Definitions", + "text": "This is the tiddler HelloThere" + } +]
\ No newline at end of file