r2 - 01 Dec 2001 - 02:16:00 - PeterThoenyYou are here: TWiki >  Codev Web > GetEmailNotifyListReturnsBadValue
Tags:
, create new tag

Bug: Function getEmailNotifyList returns bad value

The function getEmailNotifyList() can return undef which mailnotify does not know how to deal with. This results in mailnotify trying to send email to an undefined user.

The fix is to have getEmailNotifyList() return an empty list instead of undef when:

  1. no WebNotify topic is found
  2. no users specified
either that or modify mailnotify to deal with a returned undef value.

Test case

  • Run mailnotify when there is a web that has no WebNotify page. mailnotify will attempt to send email if it detected changes in the web
  • Run mailnotify when there is a web that has a WebNotify page but no users specified in the page. mailnotify will attempt to send email if it detected changes in the web

Environment

TWiki version: TWiki 01-Sep-2001
TWiki plugins: na
Server OS: Solaris 2.6
Web server: Apache 1.3.20
Perl version: 5.6.0
Client OS: Solaris 2.6
Web Browser: Netscape 4.78

-- TaitCyrus - 30 Nov 2001

Fix record

325,326d324
<     return undef unless &TWiki::Store::topicExists( $web, $topicname );
< 
327a326,327
>     return @list unless &TWiki::Store::topicExists( $web, $topicname );
> 
333c333
<     return (scalar @list ? @list : undef);    
---
>     return (@list);

This is a duplicate of UninitializedValueInMailnotifyWithEmptyWebNotify. Thanks for reporting.

-- PeterThoeny - 30 Nov 2001

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo