From 903cdc09cced272f7301f776e767dd966bb6ab34 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 14 Nov 2016 15:37:55 +0000 Subject: [PATCH] Improve checking for missing titles --- plugins/tiddlywiki/xlsx-utils/importer.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/tiddlywiki/xlsx-utils/importer.js b/plugins/tiddlywiki/xlsx-utils/importer.js index fc430a340..6bd2f0946 100644 --- a/plugins/tiddlywiki/xlsx-utils/importer.js +++ b/plugins/tiddlywiki/xlsx-utils/importer.js @@ -104,6 +104,10 @@ XLSXImporter.prototype.processRowByColumn = function() { self.tiddlerFields[name] = cell.w; } }); + // Skip the tiddler entirely if it doesn't have a title + if(!this.tiddlerFields.title) { + this.skipTiddler = true; + } }; XLSXImporter.prototype.processRowByField = function() { @@ -139,12 +143,6 @@ XLSXImporter.prototype.processField = function(fieldImportSpecTitle) { value = fieldImportSpec.fields["import-field-value"] break; } - if(fieldImportSpec.fields["import-field-prefix"]) { - value = fieldImportSpec.fields["import-field-prefix"] + value; - } - if(fieldImportSpec.fields["import-field-suffix"]) { - value = value + fieldImportSpec.fields["import-field-suffix"]; - } if((value || "").trim() === "") { if((fieldImportSpec.fields["import-field-skip-tiddler-if-blank"] || "").trim().toLowerCase() === "yes") { this.skipTiddler = true; @@ -153,6 +151,12 @@ XLSXImporter.prototype.processField = function(fieldImportSpecTitle) { value = fieldImportSpec.fields["import-field-replace-blank"]; } } + if(fieldImportSpec.fields["import-field-prefix"]) { + value = fieldImportSpec.fields["import-field-prefix"] + value; + } + if(fieldImportSpec.fields["import-field-suffix"]) { + value = value + fieldImportSpec.fields["import-field-suffix"]; + } switch(fieldImportSpec.fields["import-field-list-op"] || "none") { case "none": this.tiddlerFields[fieldName] = value;