mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
persistRevisionThreadItems: Avoid listing non-discussion pages
Bug: T329627
Change-Id: I52a9f5dfa583d8dc2e0a315844a2a40e538f6a8c
(cherry picked from commit 445b8caca0
)
This commit is contained in:
parent
e07eca8795
commit
91a041c291
|
@ -327,6 +327,8 @@ class HookUtils {
|
|||
/**
|
||||
* Check if the tools are available for a given title
|
||||
*
|
||||
* Keep in sync with SQL conditions in persistRevisionThreadItems.php.
|
||||
*
|
||||
* @param Title $title
|
||||
* @param string|null $feature Feature to check for (one of static::FEATURES)
|
||||
* Null will check for any DT feature.
|
||||
|
|
|
@ -75,6 +75,21 @@ class PersistRevisionThreadItems extends Maintenance {
|
|||
return;
|
||||
}
|
||||
|
||||
// Add conditions from HookUtils::isAvailableForTitle().
|
||||
// Keep this in sync with that method.
|
||||
$nsInfo = $services->getNamespaceInfo();
|
||||
$qb->leftJoin( 'page_props', null, [
|
||||
'pp_propname' => 'newsectionlink',
|
||||
'pp_page = page_id',
|
||||
] );
|
||||
$qb->where( $this->dbr->makeList( [
|
||||
'page_namespace' => array_values( array_filter(
|
||||
$nsInfo->getValidNamespaces(),
|
||||
[ $nsInfo, 'wantSignatures' ]
|
||||
) ),
|
||||
'pp_propname IS NOT NULL',
|
||||
], IDatabase::LIST_OR ) );
|
||||
|
||||
if ( $this->getOption( 'current' ) ) {
|
||||
$qb->where( 'rev_id = page_latest' );
|
||||
$index = [ 'page_id' ];
|
||||
|
|
Loading…
Reference in a new issue