Item1463: Missing attachment metadata generates errors in apache log

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: MichaelTempest
Waiting For:
Last Change By: CrawfordCurrie
Foswiki::UI::Upload.pm line 103 does this:
$tmpl =~ s/%FILEPATH%/$args->{path}/g;
but it does not check that the "path" meta-data is present.

This causes a "Use of uninitialised value in substitution iterator at ... Upload.pm line 103, when clicking "Attach" on the topic and then "manage" for the attachment missing the meta-data.

The "path" metadata is there if you attach a file manually. However, Foswiki::Func::saveAttachment does not throw an error if you do not supply that meta-data, and it does not provide a blank value.

I found this because the DirectedGraphPlugin calls saveAttachment but it does not supply a "filepath", which I presume ends up in the "path" meta-data. I do not think the DirectedGraphPlugin is at fault - it appears to comply with the documented interface to saveAttachment.

I was able to reproduce this problem without the DirectedGraphPlugin by attaching a file the ordinary way and then removing path="..." from the %META-FILEATTACHMENT% .

-- MichaelTempest - 18 Apr 2009

This is fixed in 1.1. No further action.

-- CrawfordCurrie - 16 Dec 2009

ItemTemplate edit

Summary Missing attachment metadata generates errors in apache log
ReportedBy MichaelTempest
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r2 - 16 Dec 2009, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy