Item11965: MailNotify fails with perl "undefined value" errors, and needs better error reporting
Priority: Normal
Current State: Closed
Released In: 1.1.6
Target Release: patch
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