Item14284: Error on topic save with SMTP method

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release:
Applies To: Extension
Component: ImmediateNotifyPlugin
Branches:
Reported By: LynnwoodBrown
Waiting For:
Last Change By: GeorgeClark
This task is based on ImmediateNotifyPlugin version in git as of May 28, 2014.

With SMTP being the only notification enabled, when a topic which tagged for notification is saved, the following errors were reported even though the topic is saved and the notification went out:
Use of uninitialized value $methodString in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm line 208.
 Can't call method "disconnect" without a package or object reference at /var/www/foswiki/lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm line 114.

The relevant code in /lib/Foswiki/Plugins/ImmediateNotifyPlugin.pm is:
112    foreach my $handler (%methodHandlers) {
113        next unless $handler;
114        $methodHandlers{$handler}->disconnect();
115        $methodHandlers{$handler} = '';
116    } 
...
205     my $methodString =
206              $topicObject->getPreference('IMMEDIATENOTIFYMETHOD');
207
208            debug(

In IRC message GeorgeClark commented that the following should work for line 113:
next unless ( $handler && $handler->can('disconnect') );

-- LynnwoodBrown - 20 Jan 2017

 
Topic revision: r2 - 26 Feb 2017, 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