From 66b736e5fb576cc7633835caaef2a7a0205b5236 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 28 Feb 2014 20:23:11 +0100 Subject: [PATCH] resourceloader: Fix broken skinStyles loop in #getModifiedTime The way we interpret the 'skinStyles' array in #getModifiedTime is broken. For comparision, look at the loop in #getStyleFiles which we use for the creation of the actual stylesheets (which works fine). It mixed up the logic causing it to always end up with an empty array. So it's not so much that it fails to detect the files having changed after an update, it never included mtimes of these files in the first place. If there'd be a module with only skinStyles resources, it would have timestamp 0 (1970). Bug: 62068 Change-Id: I2e772a13183e66e4bfbf95057ebfd7f5e0d817ec --- .../resourceloader/ResourceLoaderFileModule.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 23d58250fa..68bfe59487 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -429,10 +429,11 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { foreach ( $styles as $styleFiles ) { $files = array_merge( $files, $styleFiles ); } - $skinFiles = self::tryForKey( - self::collateFilePathListByOption( $this->skinStyles, 'media', 'all' ), - $context->getSkin(), - 'default' + + $skinFiles = self::collateFilePathListByOption( + self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ), + 'media', + 'all' ); foreach ( $skinFiles as $styleFiles ) { $files = array_merge( $files, $styleFiles ); @@ -614,7 +615,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { return array_merge_recursive( self::collateFilePathListByOption( $this->styles, 'media', 'all' ), self::collateFilePathListByOption( - self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ), 'media', 'all' + self::tryForKey( $this->skinStyles, $context->getSkin(), 'default' ), + 'media', + 'all' ) ); } -- 2.20.1