Check page_len in ResourceLoaderWikiModule::isKnownEmpty() for 'user' modules
authorKunal Mehta <legoktm@gmail.com>
Fri, 29 Aug 2014 06:31:44 +0000 (23:31 -0700)
committerOri.livneh <ori@wikimedia.org>
Sat, 30 Aug 2014 00:24:37 +0000 (00:24 +0000)
commit8968d8787fee47739649ccb2e32e883cdd2b0f4d
tree3ae6c4f69ac594b41d66620f5c373145d20e9947
parent08e50bcecd32e6646b2a07a356517feb733aad78
Check page_len in ResourceLoaderWikiModule::isKnownEmpty() for 'user' modules

In most cases, we just check whether the pages exist before saying
the module is not empty to avoid generating cached HTML without
the appropriate <script> or <link> tags.

However, for modules in the 'user' group, normal users cannot
delete their personal JavaScript/CSS pages, causing needless
extra requests, even though we know the pages are empty.

ResourceLoader::isKnownEmpty() now checks the page_len field
for modules in the 'user' group to check that there is
some actual content.

Bug: 68488
Change-Id: I0570f62887fd4642fd60367ae0b51d7dc19488ca
includes/resourceloader/ResourceLoaderWikiModule.php
tests/TestsAutoLoader.php
tests/phpunit/ResourceLoaderTestCase.php
tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php [new file with mode: 0644]