Changeset 7439
- Timestamp:
- 05/16/10 16:15:31 (2 years ago)
- Location:
- trunk/AttachmentListPlugin
- Files:
-
- 2 edited
-
lib/Foswiki/Plugins/AttachmentListPlugin.pm (modified) (3 diffs)
-
test/unit/AttachmentListPlugin/AttachmentListPluginTests.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/AttachmentListPlugin/lib/Foswiki/Plugins/AttachmentListPlugin.pm
r7396 r7439 164 164 # has META:FILEATTACHMENT data 165 165 my $attachments = _getAttachmentsInTopic( $inWeb, $inTopic ); 166 my $attach_files = _getAttachmentList( $inWeb, $inTopic ); 166 my $attach_files = _getAttachmentList( $inWeb, $inTopic ) if ($Foswiki::cfg{RCS}{AutoAttachPubFiles}) ; 167 168 #print STDERR "attachments = " . scalar @$attachments . "\n"; 169 #print STDERR "files = " . scalar @$attach_files . "\n" ; 167 170 168 171 _debug("AttachmentListPlugin::_createFileData"); … … 181 184 } 182 185 183 foreach my $fileName (@$attach_files) { 184 unless ($inTopicHash->{$inTopic}{$fileName}) { 185 my $fd = 186 Foswiki::Plugins::AttachmentListPlugin::FileData->new( $inWeb, 187 $inTopic, { name => $fileName, path => $fileName, autoattached => 1} ); 188 $inTopicHash->{$inTopic}{$fileName} = \$fd; 186 if ($Foswiki::cfg{RCS}{AutoAttachPubFiles} && defined $attach_files && (scalar @$attachments != scalar @$attach_files)) { 187 foreach my $fileName (@$attach_files) { 188 unless ($inTopicHash->{$inTopic}{$fileName}) { 189 my $fd = 190 Foswiki::Plugins::AttachmentListPlugin::FileData->new( $inWeb, 191 $inTopic, { name => $fileName, path => $fileName, autoattached => 1} ); 192 $inTopicHash->{$inTopic}{$fileName} = \$fd; 193 } 189 194 } 190 195 } … … 350 355 my ($web, $topic) = @_; 351 356 357 #print STDERR "getAttachmentList entered for $web $topic\n"; 352 358 my $dir = "$Foswiki::cfg{PubDir}/$web/$topic"; 353 359 my $dh; -
trunk/AttachmentListPlugin/test/unit/AttachmentListPlugin/AttachmentListPluginTests.pm
r7406 r7439 203 203 my $testTopic1 = $testAttachments{topic1}{name}; 204 204 my $testTopic2 = $testAttachments{topic2}{name}; 205 $Foswiki::cfg{RCS}{AutoAttachPubFiles} = 1; 205 206 206 207 my $source =
Note: See TracChangeset
for help on using the changeset viewer.
