Kaligula has uploaded a new change for review.
https://gerrit.wikimedia.org/r/61286
Change subject: (bug47219) Exclude Wikidata edits from Wikipedia feed
......................................................................
(bug47219) Exclude Wikidata edits from Wikipedia feed
Basically it marks (always) and excludes (if given a param) any item that has
not changed.
Change-Id: If22827129b04d423711f921307dc820d4840d9d1
---
M includes/api/ApiQueryWatchlist.php
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/86/61286/1
diff --git a/includes/api/ApiQueryWatchlist.php
b/includes/api/ApiQueryWatchlist.php
index 3ee15f6..e7bdfb0 100644
--- a/includes/api/ApiQueryWatchlist.php
+++ b/includes/api/ApiQueryWatchlist.php
@@ -168,6 +168,8 @@
$this->addWhereIf( 'rc_user != 0', isset(
$show['!anon'] ) );
$this->addWhereIf( 'rc_patrolled = 0', isset(
$show['!patrolled'] ) );
$this->addWhereIf( 'rc_patrolled != 0', isset(
$show['patrolled'] ) );
+ // Exclude items wihout change, e.g. Wikidata edits on
Wikipedia feed
+ $this->addWhereIf( 'rc_last_oldid != rc_this_oldid',
isset( $show['changed'] ) );
}
if ( !is_null( $params['user'] ) && !is_null(
$params['excludeuser'] ) ) {
@@ -286,11 +288,19 @@
}
if ( $this->fld_comment && isset( $row->rc_comment ) ) {
- $vals['comment'] = $row->rc_comment;
+ if ( $row->rc_this_oldid != $row->rc_last_oldid ) {
+ $vals['comment'] = $row->rc_comment;
+ } else {
+ $vals['comment'] = "(Edit on Wikidata.)";
+ }
}
if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
- $vals['parsedcomment'] = Linker::formatComment(
$row->rc_comment, $title );
+ if ( $row->rc_this_oldid != $row->rc_last_oldid ) {
+ $vals['parsedcomment'] = Linker::formatComment(
$row->rc_comment, $title );
+ } else {
+ $vals['parsedcomment'] = Linker::formatComment(
"(Edit on Wikidata.)", $title );
+ }
}
if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
@@ -373,6 +383,7 @@
'!anon',
'patrolled',
'!patrolled',
+ 'changed',
)
),
'owner' => array(
--
To view, visit https://gerrit.wikimedia.org/r/61286
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If22827129b04d423711f921307dc820d4840d9d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Kaligula <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits