Item11572: Fatal syntax error in source

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: NotificationPlugin
Branches:
Reported By: AlexisHazell
Waiting For:
Last Change By: GeorgeClark
Adding the NTF macro to a topic causes a fatal error, with the following message sent to the browser:

Can't use string ("name") as a HASH ref while "strict refs" in use at [redacted]/foswiki/lib/Foswiki/Meta.pm line 1034.
at [redacted]/foswiki/lib/Foswiki/Meta.pm line 1034
Foswiki::Meta::put('Foswiki::Meta=HASH(0x5493d30)', 'TOPICPARENT', 'name', 'undef') called at [redacted]/foswiki/lib/Foswiki/Plugins/NotificationPlugin.pm line 305

Line 305 of NotificationPlugin.pm is:

$tmpMeta->put( "TOPICPARENT", ( "name" => $who ) );

where
$tmpMeta
is an instance of Foswiki::Meta. However, as per http://foswiki.org/System/PerlDoc?module=Foswiki::Meta#ObjectMethod_put_40_36type_44_92_37args_41, the 'put' method expects to receive a hashref as its second argument. The error can thus be fixed by replacing the above line with:

$tmpMeta->put( "TOPICPARENT", { "name" => $who } );

Fixed in NotificationPlugin 2.0

-- GeorgeClark - 30 Apr 2017
 
Topic revision: r2 - 30 Apr 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