http://www.mediawiki.org/wiki/Special:Code/MediaWiki/91974
Revision: 91974
Author: brion
Date: 2011-07-12 17:21:15 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Revert r91973 " Bug 24254: Output JS var wgCategories on other actions than
view as well"
This code just looks really wrong -- it seems to be stuffing things into
OutputPage::getCategories() which seems clearly designed to only return a set
of categories that have been previously set by something else; rather than a
lazy loader it also seems to fetch them every time. Nor does it even check if
the article exists before loading from the DB -- and in general it looks like
it doesn't really fit in with other code. It also only lists itself as altering
wgCategories, but it's changing what's in the OutputPage itself so this may
affect other things.
Modified Paths:
--------------
trunk/phase3/includes/OutputPage.php
Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php 2011-07-12 16:53:46 UTC (rev
91973)
+++ trunk/phase3/includes/OutputPage.php 2011-07-12 17:21:15 UTC (rev
91974)
@@ -1168,21 +1168,6 @@
* @return Array of strings
*/
public function getCategories() {
- // mCategories will only be filled if we're coming from the
parser
- if ($this->getRequest()->getVal('action') != 'view') {
- $categories = array();
- $dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select(
- 'categorylinks',
- array( 'cl_to' ),
- 'cl_from='. $this->getTitle()->getArticleId(),
- __METHOD__
- );
- foreach( $res as $row ) {
- $categories[] = $row->cl_to;
- }
- $this->mCategories = $categories;
- }
return $this->mCategories;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs