http://www.mediawiki.org/wiki/Special:Code/MediaWiki/91973
Revision: 91973
Author: diebuche
Date: 2011-07-12 16:53:46 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Bug 24254: Output JS var wgCategories on other actions than view as well. Bug
24254
Modified Paths:
--------------
trunk/phase3/includes/OutputPage.php
Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php 2011-07-12 16:20:24 UTC (rev
91972)
+++ trunk/phase3/includes/OutputPage.php 2011-07-12 16:53:46 UTC (rev
91973)
@@ -1168,6 +1168,21 @@
* @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