Add topic containers HTML to parser cache even when feature is disabled

Remove hacks marked as 'TEMPORARY' now that we consider the
HTML to be stable enough.

This will avoid issues with HTML/CSS being out of sync in future deployments.

Bug: T313560
Change-Id: Ie00ff38a422f241add19d500adaf22dfeee10e8c
This commit is contained in:
Ed Sanders 2022-07-27 17:20:02 +01:00
parent a9ad7dbb24
commit 5e2b209314
2 changed files with 1 additions and 11 deletions

View file

@ -105,14 +105,6 @@ class CommentFormatter {
$subscribeButton = $doc->createComment( '__DTSUBSCRIBEBUTTONDESKTOP__' . $headingNameEscaped );
$headingElement->insertBefore( $subscribeButton, $headingElement->firstChild );
// TEMPORARY: If enhancements are "unavailable", don't modify the HTML at all
// so as to avoid polluting the parser cache. Once the HTML output is more stable
// this can be removed.
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'discussiontools' );
if ( $dtConfig->get( 'DiscussionTools_' . HookUtils::VISUALENHANCEMENTS ) === 'unavailable' ) {
return;
}
// Visual enhancements: topic containers
$summary = $headingItem->getThreadSummary();
if ( $summary['commentCount'] ) {

View file

@ -275,9 +275,7 @@ class HookUtils {
// Extra hack for parses from API, where this parameter isn't passed to derivative requests
RequestContext::getMain()->getRequest()->getRawVal( 'dtenable' );
// TEMPORARY: Don't enable visualenhancements by query as the HTML in the parser
// cache will not have been modified (see CommentFormatter::addTopicContainer)
if ( $queryEnable && $feature !== static::VISUALENHANCEMENTS ) {
if ( $queryEnable ) {
return true;
}