Item13101: moveTopic requires existing topic even when only handling attachments
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release:
When developing VersatileStore I inherited
PlainFileStore to let it handle attachments. However, I found a nit in moveTopic and needed to tweak one-line of code or this mixin Store would fail.
sub moveTopic {
my ( $this, $oldTopicObject, $newTopicObject, $cUID ) = @_;
_saveDamage($oldTopicObject);
my @revs;
my $rev = _numRevisions( \@revs, $oldTopicObject );
- _moveFile( _latestFile($oldTopicObject), _latestFile($newTopicObject) );
+ _moveFile( _latestFile($oldTopicObject), _latestFile($newTopicObject) )
+ if -e _latestFile($oldTopicObject);
_moveFile( _historyDir($oldTopicObject), _historyDir($newTopicObject) );
my $pub = _getPub($oldTopicObject);
if ( -e $pub ) {
_moveFile( $pub, _getPub($newTopicObject) );
}
--
JulianLevens - 17 Nov 2014