Merge "Ignore transcluded items when finding permalinks"

This commit is contained in:
jenkins-bot 2024-02-05 21:46:08 +00:00 committed by Gerrit Code Review
commit 4c2442eeb6
2 changed files with 3 additions and 3 deletions

View file

@ -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 );
}
}

View file

@ -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 )