Closed mgroth0 closed 7 years ago
The format of the title is incorrect, use:
$tw.wiki.addTiddler({
title: "[[\"Tell Me - GTA Remix -- Giraffage\"]]",
although I think you probably want
$tw.wiki.addTiddler({
title: "Tell Me - GTA Remix -- Giraffage",
What @buggyj said; title should be a String
not an Array(Array(String))
. And avoid using square brackets in titles because that just leads to headaches.
Problem solved, thanks! I should have noticed that, but since Tiddler titles were still coming out the way I wanted anyway even with the brackets, I didn't even consider it.
@matthew-groth please close the issue.
I am injecting javascript through a chrome extension in order to automate the creation of Tiddlers. For example:
After using this to create a new tiddler, I start getting this error every time I try to edit any Tiddler or create a new tiddler:
Uncaught TypeError: a.fields[sortField].toLowerCase is not a function
I'm having trouble figuring out the cause of this error. Here's the full error trace:
$:/core/modules/wiki.js:277 Uncaught TypeError: a.fields[sortField].toLowerCase is not a function at eval ($:/core/modules/wiki.js:277:32) at Array.sort (native) at $tw.Wiki.exports.getTiddlers ($:/core/modules/wiki.js:276:11) at $tw.Wiki.exports.forEachTiddler ($:/core/modules/wiki.js:377:17) at $tw.Wiki.exports.findDraft ($:/core/modules/wiki.js:1160:7) at NavigatorWidget.makeDraftTiddler ($:/core/modules/widgets/navigator.js:290:29) at NavigatorWidget.handleEditTiddlerEvent ($:/core/modules/widgets/navigator.js:229:26) at eventListeners.(anonymous function) ($:/core/modules/widgets/widget.js:368:25) at NavigatorWidget.Widget.dispatchEvent ($:/core/modules/widgets/widget.js:385:7) at DropZoneWidget.Widget.dispatchEvent ($:/core/modules/widgets/widget.js:391:28)
The error keeps happening whenever I try to add or edit a tiddler after I use my javascript to create a tiddler.
Once I refresh the page everything is fine. The Tiddler I created is still there, and I can once again create and edit Tiddlers as long as I don't use the javascript that creates tiddlers.