diff --git a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js index 1c1dc6442..7ced74865 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js @@ -295,7 +295,10 @@ SqlTiddlerStore.prototype.createRecipe = function(recipe_name,bag_names,descript } var self = this; return this.sqlTiddlerDatabase.transaction(function() { - self.sqlTiddlerDatabase.createRecipe(recipe_name,bag_names,description); + // Reverse the array to maintain the original order in the database + // since SQLite will return them in reverse order + const reversedBagNames = bag_names.slice().reverse(); + self.sqlTiddlerDatabase.createRecipe(recipe_name,reversedBagNames,description); self.dispatchEvent("change"); return null; });