jenkins-bot has submitted this change and it was merged.
Change subject: Show flow events in watchlist
......................................................................
Show flow events in watchlist
Flow events were not showing up in the watchlist due to the need to adjust a
query
issued by Special:Watchlist. A new hook to effect this change has been merged
to
master and this updates Flow to utilize it (and hence, enable watchlists).
Bug: 55597
Change-Id: I2ca72fac0153f046b2cb0f94dbc55f2fff3adf7c
---
M Flow.php
M Hooks.php
M includes/Data/RecentChanges.php
3 files changed, 16 insertions(+), 3 deletions(-)
Approvals:
Bsitu: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Flow.php b/Flow.php
index 5dc56ec..bcda687 100755
--- a/Flow.php
+++ b/Flow.php
@@ -42,7 +42,6 @@
// Constants
define( 'RC_FLOW', 142 ); // soon to be obsolete, random number chosen
-define( 'RC_SRC_FLOW', 'flow' ); // replaces RC_FLOW
// Autoload
$dir = __DIR__ . '/';
@@ -165,6 +164,7 @@
$wgHooks['TitleIsAlwaysKnown'][] = 'FlowHooks::onTitleIsAlwaysKnown';
$wgHooks['SkinTemplateNavigation::Universal'][] =
'FlowHooks::onSkinTemplateNavigation';
$wgHooks['Article::MissingArticleConditions'][] =
'FlowHooks::onMissingArticleConditions';
+$wgHooks['SpecialWatchlistGetNonRevisionTypes'][] =
'FlowHooks::onSpecialWatchlistGetNonRevisionTypes';
// Extension initialization
$wgExtensionFunctions[] = 'FlowHooks::initFlowExtension';
diff --git a/Hooks.php b/Hooks.php
index 23cb43d..4fbfe91 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -86,7 +86,7 @@
if ( $rcType !== RC_FLOW ) {
return true;
}
- } elseif ( $source !== RC_SRC_FLOW ) {
+ } elseif ( $source !== Flow\Data\RecentChanges::SRC_FLOW ) {
return true;
}
@@ -259,4 +259,14 @@
return true;
}
+
+ /**
+ * Adds Flow entries to watchlists
+ * @param array &$types Type array to modify
+ * @return boolean true
+ */
+ public static function onSpecialWatchlistGetNonRevisionTypes( &$types )
{
+ $types[] = Flow\Data\RecentChanges::SRC_FLOW;
+ return true;
+ }
}
diff --git a/includes/Data/RecentChanges.php b/includes/Data/RecentChanges.php
index 2effd74..8b62cef 100644
--- a/includes/Data/RecentChanges.php
+++ b/includes/Data/RecentChanges.php
@@ -10,6 +10,9 @@
abstract class RecentChanges implements LifecycleHandler {
+ // Value used in rc_source field of recentchanges to identify flow
specific changes
+ const SRC_FLOW = "flow";
+
// Maximum length any user generated content is truncated to before
storing
// in recentchanges
const TRUNCATE_LENGTH = 164;
@@ -44,7 +47,7 @@
'rc_user' => $row['rev_user_id'],
'rc_user_text' => $row['rev_user_text'],
'rc_type' => RC_FLOW,
- // 'rc_source' => RC_SRC_FLOW, // depends on core
change in gerrit 85787
+ 'rc_source' => self::SRC_FLOW,
'rc_minor' => 0,
'rc_bot' => 0, // TODO: is revision by bot
'rc_patrolled' => 0,
--
To view, visit https://gerrit.wikimedia.org/r/92427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2ca72fac0153f046b2cb0f94dbc55f2fff3adf7c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Werdna <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits