Skip to content

Commit

Permalink
Item11983:
Browse files Browse the repository at this point in the history
   * don't get rev info from META:TOPICINFO when asking for a different rev 
   * fixed setting the correct rev id when no META:TOPICINFO record was there previously



git-svn-id: http://svn.foswiki.org/trunk@15395 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Sep 19, 2012
1 parent 6888297 commit 7282be7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions core/lib/Foswiki/Store/VC/Store.pm
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ sub getVersionInfo {
my $info =
$this->askListenersVersionInfo( $topicObject, $rev, $attachment );

if ( not defined $info ) {
my $loadedRev = $topicObject->getLoadedRev();

if ( !defined($info) && ( !defined($rev) || $loadedRev eq $rev ) ) {
$topicObject->loadVersion() unless $topicObject->latestIsLoaded();
$info = $topicObject->get('TOPICINFO');
}
Expand Down Expand Up @@ -369,8 +371,17 @@ sub saveTopic {
# just in case they are not sequential
my $nextRev = $handler->getNextRevisionID();
my $ti = $topicObject->get('TOPICINFO');
$ti->{version} = $nextRev;
$ti->{author} = $cUID;

if ( defined $ti ) {
$ti->{version} = $nextRev;
$ti->{author} = $cUID;
}
else {
$topicObject->setRevisionInfo(
version => $nextRev,
author => $cUID,
);
}

$handler->addRevisionFromText( $topicObject->getEmbeddedStoreForm(),
'save topic', $cUID, $options->{forcedate} );
Expand Down

0 comments on commit 7282be7

Please sign in to comment.