r74525 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74524‎ | r74525 | r74526 >
Date:18:42, 8 October 2010
Author:tparscal
Status:resolved
Tags:
Comment:
* Improved on r73971 by removing the $name parameter from MessageBlobStore::gerenateMessageBlob, since it was not being used.
* Fixed bug introduced in r73971 caused by using a module name rather than a module object in MessageBlobStore::updateModule
Modified paths:
  • /trunk/phase3/includes/MessageBlobStore.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageBlobStore.php
@@ -66,7 +66,7 @@
6767 * @return mixed Message blob or false if the module has no messages
6868 */
6969 public static function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
70 - $blob = self::generateMessageBlob( $name, $module, $lang );
 70+ $blob = self::generateMessageBlob( $module, $lang );
7171
7272 if ( !$blob ) {
7373 return false;
@@ -137,7 +137,7 @@
138138
139139 foreach ( $res as $row ) {
140140 $oldBlob = $row->mr_blob;
141 - $newBlob = self::generateMessageBlob( $name, $module, $row->mr_lang );
 141+ $newBlob = self::generateMessageBlob( $module, $row->mr_lang );
142142
143143 if ( $row->mr_lang === $lang ) {
144144 $retval = $newBlob;
@@ -330,7 +330,7 @@
331331 // older than $wgCacheEpoch
332332 if ( array_keys( FormatJson::decode( $row->mr_blob, true ) ) !== $module->getMessages() ||
333333 wfTimestamp( TS_MW, $row->mr_timestamp ) <= $wgCacheEpoch ) {
334 - $retval[$row->mr_resource] = self::updateModule( $row->mr_resource, $lang );
 334+ $retval[$row->mr_resource] = self::updateModule( $module, $lang );
335335 } else {
336336 $retval[$row->mr_resource] = $row->mr_blob;
337337 }
@@ -345,7 +345,7 @@
346346 * @param $lang string Language code
347347 * @return string JSON object
348348 */
349 - private static function generateMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
 349+ private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
350350 $messages = array();
351351
352352 foreach ( $module->getMessages() as $key ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r74614(bug 25474) Fix wrong parameters in updateModule() call. r74525 tried to fix ...catrope08:32, 11 October 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73971Made ResourceLoader an instantiable object, rather than a static one, making ...tparscal19:04, 29 September 2010

Status & tagging log