mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-17 18:41:01 +00:00
persistRevisionThreadItems: Avoid listing non-discussion pages
Bug: T329627
Change-Id: I52a9f5dfa583d8dc2e0a315844a2a40e538f6a8c
(cherry picked from commit 445b8caca0
)
This commit is contained in:
parent
55b0167868
commit
8c9a65e671
|
@ -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