1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-07 19:13:00 +00:00

Fix problems with $tw.utils.checkVersions()

Previous changes since 5.1.7 broke the documented semantics by no
longer returning true when the versions match. It affected the upgrade
process, making it impossible to upgrade to a later pre-release (ie
where the version numbers in the upgrade.html match those in the file
being upgraded).

Also reviewed and updated the calls to checkVersions.

@felixhayashi I think that this effectively reverts the change you
original submitted. Are you OK with it?
This commit is contained in:
Jermolene
2015-02-12 23:04:20 +00:00
parent ddac13317e
commit e386e26b2d
3 changed files with 7 additions and 9 deletions

View File

@@ -40,14 +40,12 @@ exports.upgrade = function(wiki,titles,tiddlers) {
var incomingTiddler = tiddlers[title];
// Check if we're dealing with a plugin
if(incomingTiddler && incomingTiddler["plugin-type"] && incomingTiddler.version) {
// Upgrade the incoming plugin if we've got a newer version in the upgrade library
// Upgrade the incoming plugin if it is in the upgrade library
var libraryTiddler = getLibraryTiddler(title);
if(libraryTiddler && libraryTiddler["plugin-type"] && libraryTiddler.version) {
if($tw.utils.checkVersions(libraryTiddler.version,incomingTiddler.version)) {
tiddlers[title] = libraryTiddler;
messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Upgraded",{variables: {incoming: incomingTiddler.version, upgraded: libraryTiddler.version}});
return;
}
tiddlers[title] = libraryTiddler;
messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Upgraded",{variables: {incoming: incomingTiddler.version, upgraded: libraryTiddler.version}});
return;
}
// Suppress the incoming plugin if it is older than the currently installed one
var existingTiddler = wiki.getTiddler(title);