_Copied from
http://twiki.org/cgi-bin/view/Plugins/SubscribePluginDev_Using TWiki 4.1.1 and the
SubscribePlugin version 13787 - 18 May 2007 (mind you, even the latest version from 20 Feb 2008 is still version 13787 in the source code and it still has the same bit of problem code). When you define the level of children topics you want to subscribe to in the WebNotify topic (e.g. MyTopic (3)) the Subscribe Plugin fails when it uses the MailerContrib isSubscribedTo function because it doesn't pass a $db variable and thus the getParent function is undefined. In the
SubscribePlugin.pm
file in the first
else
statement of
_getbutton
, somewhere after the
#checking if the user has subscribed for that topic already
comment but before the
if ( $subscriber-> isSubscribedTo...
you have to add
<verbatim>
require TWiki::Contrib::MailerContrib::UpData;
my $db = new TWiki::Contrib::MailerContrib::Updata( $session, $web );
</verbatim>
and then the above
if
statement becomes
=if ( $subscriber->isSubscribedTo($stopics, $db) ) {=
Hope that makes sense, sorry the lack of a patch file.
--
TWiki:Main.DavidPatterson - 31 Mar 2008
Thanks David, i merged your patch.
--
CrawfordCurrie - 25 May 2008