From 251f5d3426db4cdfa260ee167738b47cdce21567 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 8 Mar 2022 17:49:15 -0500 Subject: [PATCH] Redefining unique Ids for the Tiddlers. --- repository/TiddlyWiki/Tiddler.class.st | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/repository/TiddlyWiki/Tiddler.class.st b/repository/TiddlyWiki/Tiddler.class.st index 5eec807..afdf1b7 100644 --- a/repository/TiddlyWiki/Tiddler.class.st +++ b/repository/TiddlyWiki/Tiddler.class.st @@ -155,7 +155,7 @@ Tiddler >> exportSTONFileInto: subfolder [ | stonFile output dashedTitle sanitized date | dashedTitle := '-' join: (self title substrings collect: [ :each | each ]). sanitized := dashedTitle copyWithoutAll: #($¿ $? $! $¡ $/). - date := self created hash hex copyFrom: 1 to: 5. + date := self uid. stonFile := self wiki file parent / subfolder / (sanitized, '--', date, '.ston'). ^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty ] @@ -457,6 +457,17 @@ Tiddler >> type: anObject [ type := anObject ] +{ #category : #accessing } +Tiddler >> uid [ + | tempId | + self created + ifNotNil: [ tempId := self created hash hex copyFrom: 1 to: 5. ] + ifNil: [ tempId := self class nowLocal hash hex copyFrom: 1 to: 5 ]. + self customFields at: 'uid' put: tempId . + ^ tempId + +] + { #category : #accessing } Tiddler >> wiki [ ^ wiki