fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-27 04:40 am

[dw-free] Files need_res'd for multiple groups only show up in the first group

[commit: http://hg.dwscoalition.org/dw-free/rev/8b41e0a285a5]

http://bugs.dwscoalition.org/show_bug.cgi?id=4291

Use the group + the filename to determine uniqueness, not just the filename.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Web.pm
--------------------------------------------------------------------------------
diff -r a7530eb7c7e3 -r 8b41e0a285a5 cgi-bin/LJ/Web.pm
--- a/cgi-bin/LJ/Web.pm	Fri Jan 27 11:17:11 2012 +0800
+++ b/cgi-bin/LJ/Web.pm	Fri Jan 27 12:41:29 2012 +0800
@@ -2493,7 +2493,7 @@
         # we put javascript in the 'default' group and CSS in the 'all' group
         # since we need CSS everywhere and we are switching JS groups
         my $lgroup = $group || ( $reskey =~ /^js/ ? 'default' : 'all' );
-        unless ($LJ::NEEDED_RES{$reskey}++) {
+        unless ($LJ::NEEDED_RES{"$lgroup-$reskey"}++) {
             $LJ::NEEDED_RES[$priority] ||= [];
 
             push @{$LJ::NEEDED_RES[$priority]}, [ $lgroup, $resinclude ];
@@ -2609,7 +2609,7 @@
             # the same file may have been included twice
             # if it was in two different groups and not JS
             # so add another check here
-            next if $included{$what};
+            return if $included{$what};
             $included{$what} = 1;
 
             # in the concat-res case, we don't directly append the URL w/
--------------------------------------------------------------------------------