Fix issues with creation and modification dates

There were several places where tiddlers were being written without the
creation/modification details being updated.

See
https://groups.google.com/d/msgid/tiddlywiki/17ef8ab0-0128-4467-8a9d-f17
bdbcf3618%40googlegroups.com
This commit is contained in:
Jermolene 2015-09-11 13:30:45 +01:00
parent 35e84c41ed
commit eb9fb6635d
6 changed files with 8 additions and 6 deletions

View File

@ -170,7 +170,7 @@ var Command = function(params,commander,callback) {
if(fields.revision) {
delete fields.revision;
}
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title},state.wiki.getModificationFields()));
var changeCount = state.wiki.getChangeCount(title).toString();
response.writeHead(204, "OK",{
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\"",

View File

@ -82,9 +82,11 @@ Story.prototype.addToStory = function(navigateTo,navigateFromTitle,options) {
Story.prototype.saveStoryList = function(storyList) {
var storyTiddler = this.wiki.getTiddler(this.storyTitle);
this.wiki.addTiddler(new $tw.Tiddler(
this.wiki.getCreationFields(),
{title: this.storyTitle},
storyTiddler,
{list: storyList}
{list: storyList},
this.wiki.getModificationFields()
));
};

View File

@ -67,7 +67,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
removeFields[name] = undefined;
}
});
this.wiki.addTiddler(new $tw.Tiddler(tiddler,removeFields));
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getModificationFields(),tiddler,removeFields,this.wiki.getCreationFields()));
}
return true; // Action was invoked
};

View File

@ -125,7 +125,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
}
}
if(hasChanged) {
this.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
}
};

View File

@ -299,7 +299,7 @@ EditBitmapWidget.prototype.saveChanges = function() {
type = dataURL.substring(posColon+1,posSemiColon),
text = dataURL.substring(posComma+1);
var update = {type: type, text: text};
this.wiki.addTiddler(new $tw.Tiddler(tiddler,update));
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getModificationFields(),tiddler,update,this.wiki.getCreationFields()));
}
};

View File

@ -79,7 +79,7 @@ RadioWidget.prototype.setValue = function() {
var tiddler = this.wiki.getTiddler(this.radioTitle),
addition = {};
addition[this.radioField] = this.radioValue;
this.wiki.addTiddler(new $tw.Tiddler({title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),{title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));
}
};