UseModWiki | WikiBugs | RecentChanges | Preferences

Fixed for 1.0. --CliffordAdams
When user chooses to send an email notification, but nobody has ever registered their email address, the $DataDir/emails file doesn't yet exist and the last sentence in the quoted code causes the script to die (leaving an edit lock file, and preventing any further edits). Sort of an obscure corner case... but the fix is easy and without any harm (so long as I can tell).

sub EmailNotify {
  local $/ = "\n";   # don't slurp whole files in this sub.
  if ($EmailNotify) {
    my ($id, $user) = @_;
    if ($user) {
      $user = " by $user";
    my $address;
      open(EMAIL, "$DataDir/emails")
      or die "Can't open $DataDir/emails: $!\n";


 if(!-e "$DataDir/emails"){ return;}
before the open statement.

UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited August 12, 2003 3:03 pm by CliffordAdams (diff)