From: Roan Kattouw Date: Fri, 11 Feb 2011 08:07:47 +0000 (+0000) Subject: Fix getMsgBlobMtime() to also cause a cache invalidation if a module has messages... X-Git-Tag: 1.31.0-rc.0~32051 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=370d700dd6c62ce1ee25f0c1b2d9d069d6cf3125;p=lhc%2Fweb%2Fwiklou.git Fix getMsgBlobMtime() to also cause a cache invalidation if a module has messages but no stored message blob --- diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index dd4fc0e0e7..f8ed3d23c1 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -229,7 +229,7 @@ abstract class ResourceLoaderModule { * Get the last modification timestamp of the message blob for this * module in a given language. * @param $lang String: Language code - * @return Integer: UNIX timestamp, or 0 if no blob found + * @return Integer: UNIX timestamp, or 0 if the module doesn't have messages */ public function getMsgBlobMtime( $lang ) { if ( !isset( $this->msgBlobMtime[$lang] ) ) { @@ -242,7 +242,12 @@ abstract class ResourceLoaderModule { 'mr_lang' => $lang ), __METHOD__ ); - $this->msgBlobMtime[$lang] = $msgBlobMtime ? wfTimestamp( TS_UNIX, $msgBlobMtime ) : 0; + // If no blob was found, but the module does have messages, that means we need + // to regenerate it. Return NOW + if ( !$msgBlobMtime ) { + $msgBlobMtime = wfTimestamp( TS_UNIX ); + } + $this->msgBlobMtime[$lang] = wfTimestamp( TS_UNIX, $msgBlobMtime ); } return $this->msgBlobMtime[$lang]; }