r78018 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78017‎ | r78018 | r78019 >
Date:21:45, 7 December 2010
Author:tparscal
Status:ok
Tags:
Comment:
Improves on r77693 by ensuring site styles are loaded just before user styles.
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2588,15 +2588,19 @@
25892589 }
25902590 }
25912591
2592 - // Split the styles into two groups, not user (0) and user (1)
2593 - $styles = array( array(), array() );
 2592+ // Split the styles into three groups
 2593+ $styles = array( 'other' => array(), 'user' => array(), 'site' => array() );
25942594 $resourceLoader = $this->getResourceLoader();
25952595 foreach ( $this->getModuleStyles() as $name ) {
2596 - $styles[$resourceLoader->getModule( $name )->getGroup() === 'user' ? 1 : 0][] = $name;
 2596+ $group = $resourceLoader->getModule( $name )->getGroup();
 2597+ // Modules in groups named "other" or anything different than "user" or "site" will
 2598+ // be placed in the "other" group
 2599+ $styles[isset( $style[$group] ) ? $group : 'other'][] = $name;
25972600 }
25982601 // Add styles to tags, user modules last
2599 - $tags[] = $this->makeResourceLoaderLink( $sk, $styles[0], 'styles' );
2600 - $tags[] = $this->makeResourceLoaderLink( $sk, $styles[1], 'styles' );
 2602+ $tags[] = $this->makeResourceLoaderLink(
 2603+ $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles'
 2604+ );
26012605 return implode( "\n", $tags );
26022606 }
26032607

Follow-up revisions

RevisionCommit summaryAuthorDate
r78027Fix for bug 26128. Also needs r78023 and r78018pdhanda22:47, 7 December 2010
r780961.17: Merge recent fixes tagged on CodeReview, except for problematic revisio...catrope21:17, 8 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77693Resolves bug #26131 by always placing user scripts and styles at the very end...tparscal23:59, 3 December 2010

Status & tagging log