dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix numerous FileRepo IDEA warnings
[lhc/web/wiklou.git]
/
includes
/
CategoryViewer.php
diff --git
a/includes/CategoryViewer.php
b/includes/CategoryViewer.php
index
490f548
..
c858dd7
100644
(file)
--- a/
includes/CategoryViewer.php
+++ b/
includes/CategoryViewer.php
@@
-19,6
+19,7
@@
*
* @file
*/
*
* @file
*/
+use MediaWiki\MediaWikiServices;
class CategoryViewer extends ContextSource {
/** @var int */
class CategoryViewer extends ContextSource {
/** @var int */
@@
-286,7
+287,7
@@
class CategoryViewer extends ContextSource {
}
function doCategoryQuery() {
}
function doCategoryQuery() {
- $dbr = wfGetDB( DB_
SLAVE
, 'category' );
+ $dbr = wfGetDB( DB_
REPLICA
, 'category' );
$this->nextPage = [
'page' => null,
$this->nextPage = [
'page' => null,
@@
-317,10
+318,21
@@
class CategoryViewer extends ContextSource {
$res = $dbr->select(
[ 'page', 'categorylinks', 'category' ],
$res = $dbr->select(
[ 'page', 'categorylinks', 'category' ],
- [ 'page_id', 'page_title', 'page_namespace', 'page_len',
- 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title',
- 'cat_subcats', 'cat_pages', 'cat_files',
- 'cl_sortkey_prefix', 'cl_collation' ],
+ array_merge(
+ LinkCache::getSelectFields(),
+ [
+ 'page_namespace',
+ 'page_title',
+ 'cl_sortkey',
+ 'cat_id',
+ 'cat_title',
+ 'cat_subcats',
+ 'cat_pages',
+ 'cat_files',
+ 'cl_sortkey_prefix',
+ 'cl_collation'
+ ]
+ ),
array_merge( [ 'cl_to' => $this->title->getDBkey() ], $extraConds ),
__METHOD__,
[
array_merge( [ 'cl_to' => $this->title->getDBkey() ], $extraConds ),
__METHOD__,
[
@@
-338,10
+350,13
@@
class CategoryViewer extends ContextSource {
);
Hooks::run( 'CategoryViewer::doCategoryQuery', [ $type, $res ] );
);
Hooks::run( 'CategoryViewer::doCategoryQuery', [ $type, $res ] );
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$count = 0;
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
$count = 0;
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
+ $linkCache->addGoodLinkObjFromRow( $title, $row );
+
if ( $row->cl_collation === '' ) {
// Hack to make sure that while updating from 1.16 schema
// and db is inconsistent, that the sky doesn't fall.
if ( $row->cl_collation === '' ) {
// Hack to make sure that while updating from 1.16 schema
// and db is inconsistent, that the sky doesn't fall.