You are here: Foswiki>Tasks Web>Item11965 (02 Dec 2012, GeorgeClark)Edit Attach

Item11965: MailNotify fails with perl "undefined value" errors, and needs better error reporting

pencil
Priority: Normal
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Extension
Component: TopicUserMappingContrib
Branches: Release01x01 trunk
Reported By: DavidMasterson
Waiting For:
Last Change By: GeorgeClark
I get a lot of emails that look like the following:

Subject: Cron <apache@adbu-vm2> cd /var/www/foswiki/tools && perl -I ../bin mailnotify -q Can't use an undefined value as an ARRAY reference at /auto/adbuwiki/Foswiki-1.1.5/lib/Foswiki/Users/TopicUserMapping.pm line 1244.

Crawford says that this is likely due to an unregistered email address in the notify list. It would be helpful if:

1. This message was more explicit about what the problem is. 2. This message included both the Web(s) and User(s) to which it applied.

-- DavidMasterson - 21 Jun 2012

Changed line 1244 in TopicUserMapping.pm to:

push( @users, @{ $this->{_MAP_OF_EMAILS}->{$email} } ) if ( $this->{_MAP_OF_EMAILS}->{$email} );

This seems to get past the problem, but it may not be the proper solution. This change was local in my Wiki -- a developer should evaluate if it should be applied.

-- DavidMasterson - 29 Aug 2012

I added unit tests, and your fix and another one shown up by the tests. Always a good idea to contribute a unit test with your patches!

-- CrawfordCurrie - 30 Aug 2012

 

ItemTemplate edit

Summary MailNotify fails with perl "undefined value" errors, and needs better error reporting
ReportedBy DavidMasterson
Codebase 1.1.5, trunk
SVN Range
AppliesTo Extension
Component TopicUserMappingContrib
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:77160c018e65 distro:5b72fe3725f9
TargetRelease patch
ReleasedIn 1.1.6
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:77160c018e65
Release01x01Checkins distro:5b72fe3725f9
Topic revision: r8 - 02 Dec 2012, GeorgeClark - This page was cached on 29 May 2016 - 08:04.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License