You are here: Foswiki>Tasks Web>Item2076 (15 Mar 2011, GeorgeClark)Edit Attach

Item2076: manage attachment fails if metadata is missing the path variable

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: TopicAttachment
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Attach.pm fails with the following error:

Use of uninitialized value in substitution iterator at /var/www/SVN/foswiki/core/lib/Foswiki/UI/Attach.pm line 91.
 at /usr/lib/perl5/vendor_perl/5.8.8/CGI/Carp.pm line 356
   CGI::Carp::realdie('Use of uninitialized value in substitution iterator at /var/w...') called at /usr/lib/perl5/vendor_perl/5.8.8/CGI/Carp.pm line 437
   CGI::Carp::die('Use of uninitialized value in substitution iterator at /var/w...') called at /var/www/SVN/foswiki/core/lib/Foswiki.pm line 159
   Foswiki::__ANON__('Use of uninitialized value in substitution iterator at /var/w...') called at /var/www/SVN/foswiki/core/lib/Foswiki/UI/Attach.pm line 91
   Foswiki::UI::Attach::attach('Foswiki=HASH(0xa691a6c)') called at /var/www/SVN/foswiki/core/lib/Foswiki/UI.pm line 313
   Foswiki::UI::__ANON__() called at /usr/lib/perl5/vendor_perl/5.8.8/Error.pm line 415
   eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/Error.pm line 407
   Error::subs::try('CODE(0xa5df54c)', 'HASH(0xace08a4)') called at /var/www/SVN/foswiki/core/lib/Foswiki/UI.pm line 402
   Foswiki::UI::_execute('Foswiki::Request=HASH(0xa6914d8)', 'CODE(0xa698404)', 'attach', 1) called at /var/www/SVN/foswiki/core/lib/Foswiki/UI.pm line 287
   Foswiki::UI::handleRequest('Foswiki::Request=HASH(0xa6914d8)') called at /var/www/SVN/foswiki/core/lib/Foswiki/Engine/CGI.pm line 29
   Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0xa5633a0)') called at attach line 45.

Simple fix for Attach.pm, but wondering if the metadata should all be validated somewhere earlier instead of verifying everywhere when used?

    $tmpl =~ s/%FILEPATH%/$args->{path}/g;

change to:

    my $filePath = $args->{path} || $fileName;
    $tmpl =~ s/%FILEPATH%/$filePath/g;

Checking in fix for now.


Metadata appears to be validated - This fix appeared to resolve the issue. Closing.

ItemTemplate edit

Summary manage attachment fails if metadata is missing the path variable
ReportedBy GeorgeClark
Codebase
SVN Range Foswiki-1.1.0-dev, Mon, 14 Sep 2009, build 4896
AppliesTo Engine
Component TopicAttachment
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:0e31eabc1000 distro:a6ad59e78885
TargetRelease minor
ReleasedIn n/a
Topic revision: r6 - 15 Mar 2011, GeorgeClark
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