From eace1202a2d703ff3fe847daf2e7561aea923372 Mon Sep 17 00:00:00 2001 From: SvenDowideit Date: Sun, 24 Apr 2011 05:43:32 +0000 Subject: [PATCH] Item10675: add defaulting to the object we're saving into MongoDB so that plain .txt files work correctly - I consider this a workaround git-svn-id: http://svn.foswiki.org/trunk/MongoDBPlugin@11538 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- lib/Foswiki/Plugins/MongoDBPlugin.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Foswiki/Plugins/MongoDBPlugin.pm b/lib/Foswiki/Plugins/MongoDBPlugin.pm index 51cc99c..482e0ad 100644 --- a/lib/Foswiki/Plugins/MongoDBPlugin.pm +++ b/lib/Foswiki/Plugins/MongoDBPlugin.pm @@ -357,7 +357,14 @@ sub _updateTopic { } } } - + #workaround for Item10675 - a not-foswiki .txt file + if (not defined($meta->{'TOPICINFO'})) { + $meta->{'TOPICINFO'}->{version} = '1'; + $meta->{'TOPICINFO'}->{date} = '0'; + $meta->{'TOPICINFO'}->{rev} = '1'; + $meta->{'TOPICINFO'}->{author} = 'BaseUserMapping_999'; + $meta->{'TOPICINFO'}->{_authorWikiName} = 'UnknownUser'; + } $meta->{_raw_text} = $savedMeta->getEmbeddedStoreForm();