From 05d004fed103cd782eb880c2914aa5f8ae7dbd4d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 26 May 2008 22:43:42 +0000 Subject: [PATCH] * Show if pages are both image linked/transcluded * Remove comment: on second though, this can't happen --- includes/SpecialWhatlinkshere.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index bcdb7f3a6e..035b73c925 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -158,9 +158,9 @@ class WhatLinksHerePage { $props = array(); if ( $row->page_is_redirect ) $props[] = $msgcache['isredirect']; - if ( $row->is_template ) + if ( $row->template ) $props[] = $msgcache['istemplate']; - if ( $row->is_image ) + if ( $row->image ) $props[] = $msgcache['isimage']; if ( count( $props ) ) { @@ -350,9 +350,6 @@ class WhatLinksHerePager extends AlphabeticPager { /** * Do a query with specified parameters - * Note: in theory this could miss results if there were - * so many rows with the same page_id that the UNION table was - * exhausted and more rows should have been scanned in its creation. * * @param string $offset Index offset, inclusive * @param integer $limit Exact query limit @@ -390,7 +387,8 @@ class WhatLinksHerePager extends AlphabeticPager { $SQLqueries[] = '('.$this->mDb->selectSQLText( $tables, $fields, $conds, $fname, $options, $join_conds ).')'; } // Contruct the final query. UNION the mini-queries and merge the results. - $SQL = 'SELECT * FROM (' . implode(' UNION ',$SQLqueries) . ') AS result_links'; + $fields = 'page_id,page_namespace,page_title,page_is_redirect,MAX(is_template) AS template,MAX(is_image) AS image'; + $SQL = "SELECT $fields FROM (" . implode(' UNION ',$SQLqueries) . ") AS result_links"; // Remove duplicates within the result set. $SQL .= ' GROUP BY page_id'; // Use proper order of result set -- 2.20.1