When you use something like this in a plugin

TWiki::Func::saveAttachment($web, $topic, $fileName,
                            { file => $tempName,
                               filedate => $fileDate,
                               filesize => $fileSize,
                               filepath => $fileName,
                               comment => "Generated by !AttachContentPlugin"
                            });

Then you get this kind of garbage in the meta


Why do we get these useless parameters?

stream="GLOB(0xa421c98)" tmpFilename="/tmp/Z4IDRIcEXv"

This is found both on 4.0.4-4 and on MAIN

The quick testcase for this is to use the AttachContentPlugin and make a topic with this.

%STARTATTACH{"myfile.txt"}%
Some test text
And a little more
%ENDATTACH%

KJL

They happen to be lying around in Meta. They are cache parameters, same as most of the content of META:FILEATTACHMENT.

Perhaps a bit inelegant, but not a bug.

CC

Then let us call it an enhancement though still with low priority. Peter and I discussed this on IRC and we agreed that this garbage should not be in the META:FILEATTACHMENT. There should only be the parameters that are actually useful. And having a value saying GLOB(0xa421c98) is right out bad programming.

I spent hours trying to find out what I did wrong using TWiki::Func::saveAttachment and others will for sure have the same experience.

I am getting pretty annoyed about how quickly bug items are being discarded here without dialog, and I want that discussed at next release meeting. It is really annoying me and I know others are annoyed about it as well.

KJL

These extra parameters are harmless, but also pointless and should be gardened out before saving the topic. However this requires a spec of what should be saved in %META:, which opens a whole other can of worms, related to Item773.

-- CrawfordCurrie - 08 Mar 2009

-- CrawfordCurrie - 08 Mar 2009

This appears to be fixed in Trunk - I'm not seeing any stream or tmpFile attributes being created with either web attach or the Func API. Attributes were delete as part of Item4695 restructuring of Store and Meta.

ItemTemplate edit

Summary TWiki::Func::saveAttachment saves a lot of garbage in META
ReportedBy TWiki:Main.KennethLavrsen
Codebase 1.0.10, trunk
SVN Range TWiki-4.1, Sun, 08 Oct 2006, build 11688
AppliesTo Engine
Component CodeRefactoring
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins
TargetRelease minor
ReleasedIn 1.1.0
Topic attachments
I Attachment Action Size Date Who Comment
asdf3.txttxt asdf3.txt manage 0.1 K 18 Sep 2010 - 22:11 GeorgeClark  
myfile.txttxt myfile.txt manage 0.1 K 19 Oct 2006 - 08:21 KennethLavrsen Generated by AttachContentPlugin
Topic revision: r7 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License