• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7410: Don't notify oneself when watching topics; set minor change when updating watchlist topic

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension WatchlistPlugin Enhancement Closed   patch 6.0.1

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

When toggling the watch status of a topic, WatchlistPlugin doesn't set the 'minor' flag if it must create the *Watchlist topic. This causes *Watchlist creation to appear in the MailerContrib topic change e-mails, unless a user explicitly excludes them.

Creation of *Watchlists is not interesting, as they record a change to a per-user preference and it's that user who makes the change. Why would the other 10,000 users care that I just created my Watchlist? Why would I want 10,000 notices that each of them created theirs?

Since MailerContrib was there first, and the default is to watch '*', this amounts to having MailerContrib spam on behalf of WatchlistPlugin. This is undesirable.

Note that the calls to saveTopicText do set the 'minor revision' flag; only the call to saveTopic fails to do so.

Fix:

--- /var/www/servers/twiki/lib/TWiki/Plugins/WatchlistPlugin/Core.pm~   2014-01-16 10:30:12.000000000 -0500
+++ /var/www/servers/twiki/lib/TWiki/Plugins/WatchlistPlugin/Core.pm    2014-01-17 06:56:03.000000000 -0500
@@ -300,11 +300,11 @@
         # watchlist topic does not exist, so create it
         my ( $meta, $text ) = TWiki::Func::readTopic( $TWiki::cfg{SystemWebName},
                                                       'WatchlistTemplate' );
         $text = TWiki::Func::expandVariablesOnTopicCreation( $text );
         $meta->put( 'TOPICPARENT', { name => TWiki::Func::getWikiName() } );
-        TWiki::Func::saveTopic( $wWeb, $wTopic, $meta, $text, {} );
+        TWiki::Func::saveTopic( $wWeb, $wTopic, $meta, $text, { minor => 1 } );
     }
     $this->_updateWatchlistTopic( $wWeb, $wTopic, "$web.$topic", '', 1 );
     $this->{redirect} = "$web, $topic";
 }


While we're here, the following non-functional changes allow emacs syntax highlighting to parse the file properly (it doesn't find the end of the s/regexs). It's also safer syntax for a code (/e) replacement.

--- /var/www/servers/twiki/lib/TWiki/Plugins/WatchlistPlugin/Core.pm.orig       2013-09-15 18:09:19.000000000 -0400
+++ /var/www/servers/twiki/lib/TWiki/Plugins/WatchlistPlugin/Core.pm    2014-01-17 06:56:03.000000000 -0500
@@ -281,11 +283,11 @@
         $url = '%SCRIPTURL{viewauth}%/' . "$web/$topic?createifnotexist=1"
              . ';templatetopic=%SYSTEMWEB%.WatchlistTemplate;topicparent=' . $wikiName
     }
     $format =~ s/\$url/$url/go;
     $format =~ s/\$wikiname/$wikiName/go;
-    $format =~ s/\$watch/ $this->{baseWatchFlag} ? 'Unwatch' : 'Watch' /geo;
+    $format =~ s{\$watch}{ $this->{baseWatchFlag} ? 'Unwatch' : 'Watch' }geo;
     $this->{text} .= $format;
 }

 # =========================
 sub _actionToggleWatch {
@@ -298,11 +300,11 @@
         # watchlist topic does not exist, so create it
         my ( $meta, $text ) = TWiki::Func::readTopic( $TWiki::cfg{SystemWebName},
                                                       'WatchlistTemplate' );
         $text = TWiki::Func::expandVariablesOnTopicCreation( $text );
         $meta->put( 'TOPICPARENT', { name => TWiki::Func::getWikiName() } );
-        TWiki::Func::saveTopic( $wWeb, $wTopic, $meta, $text, {} );
+        TWiki::Func::saveTopic( $wWeb, $wTopic, $meta, $text, { minor => 1 } );
     }
     $this->_updateWatchlistTopic( $wWeb, $wTopic, "$web.$topic", '', 1 );
     $this->{redirect} = "$web, $topic";
 }

-- TWiki:Main/TimotheLitt - 2014-01-17

Thanks Timothe!

Timothe did the checkin using Item7411. Marking as "waiting for release".

-- TWiki:Main.PeterThoeny - 2014-05-19

ItemTemplate
Summary Don't notify oneself when watching topics; set minor change when updating watchlist topic
ReportedBy TWiki:Main.TimotheLitt
Codebase ~twiki4, 6.0.0
SVN Range TWiki-6.0.1-trunk, Thu, 09 Jan 2014, build 26720
AppliesTo Extension
Component WatchlistPlugin
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins

TargetRelease patch
ReleasedIn 6.0.1
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2014-10-06 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback