Author: 11fallingleaves
Description:
When running
php maintenance/rebuildFileCache.php
script headers are not added to the resulting cached pages, disabling the functionality to expand categories.
I have tested this with these settings:
$wgCategoryTreeSidebarRoot = 'Articles'; $wgCategoryTreeSidebarOptions['mode'] = 'pages';
This enables $wgCategoryTreeForceHeaders.
The problem lies in the use of $wgOut (which is deprecated). When $wgCategoryTreeForceHeaders is enabled, the problem is here, in CategoryTree.php:
if ( $wgCategoryTreeForceHeaders ) {
CategoryTree::setHeaders( $wgOut );
} else {
$wgHooks['OutputPageParserOutput'][] = 'efCategoryTreeParserOutput';
}
This is only run once on initialization. So, when caching pages with rebuildFileCache.php, subsequent pages do not get the headers they need (I have not verified whether the first one gets them, but I don't think that's very important).
I have made some changes that make rebuildFileCache work again when $wgCategoryTreeForceHeaders is enabled (by not using $wgOut), but ideally $wgOut should not be used anywhere anymore preventing such problems. I can post the changes if needed, but they only really fix half of the problem.
Version: REL1_22-branch
Severity: normal