diff --git a/includes/ApiDiscussionToolsFindComment.php b/includes/ApiDiscussionToolsFindComment.php index 64732c1de..3719b29ac 100644 --- a/includes/ApiDiscussionToolsFindComment.php +++ b/includes/ApiDiscussionToolsFindComment.php @@ -84,7 +84,6 @@ class ApiDiscussionToolsFindComment extends ApiBase { if ( $redirects === 1 && $value['couldredirect'] ) { $value['shouldredirect'] = true; } - unset( $value['couldredirect'] ); $this->getResult()->addValue( $this->getModuleName(), null, $value ); } } diff --git a/modules/controller.js b/modules/controller.js index a241c59f6..93cb03fd1 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -619,8 +619,9 @@ function init( $container, state ) { var titles = []; if ( result.discussiontoolsfindcomment ) { titles = result.discussiontoolsfindcomment.map( function ( threadItemData ) { - // oldid=null means the item appears on the current revision of the page - if ( !threadItemData.oldid ) { + // Only show items that appear on the current revision of their page + // and are not transcluded from another page + if ( threadItemData.couldredirect ) { var title = mw.Title.newFromText( threadItemData.title + '#' + mw.util.escapeIdForLink( threadItemData.id )