Page MenuHomePhabricator

Add a hook to getQueryInfo available for all QueryPage
Open, Needs TriagePublic


We have currently WantedPages::getQueryInfo, and I've used this hook to consider only links from articles in Special:WantedPages:

# Consider only links from articles
# Original query defined in SpecialWantedPages.php
$wgHooks['WantedPages::getQueryInfo'][] = function( &$wantedPages, &$query ) {
        global $wgContentNamespaces;
        # Removing this condition: 'pg2.page_namespace != ' . $dbr->addQuotes( NS_MEDIAWIKI ),
        unset( $query['conds'][2] );
        $query['conds']['pg2.page_namespace'] = $wgContentNamespaces;

But this seems to be the only WantedQueryPage or QueryPage to have a hook to allow modifying the behavior without hacking core. I can't do this for other similar pages like WantedTemplates, etc

Having such a hook would allow individual installations to tune up this query to fit their needs.