Merge "Always set a value for isEmptyTalkPage when transforming html"

This commit is contained in:
jenkins-bot 2024-09-23 18:43:23 +00:00 committed by Gerrit Code Review
commit 936ba19113

View file

@ -410,9 +410,12 @@ class CommentFormatter {
->addTrackingCategory( $pout, 'discussiontools-comments-before-first-heading-category', $title ); ->addTrackingCategory( $pout, 'discussiontools-comments-before-first-heading-category', $title );
} }
if ( count( $threadItems ) === 0 ) { // FIXME: Similar to `setJsConfigVar` below, this will eventually throw
$pout->setExtensionData( 'DiscussionTools-isEmptyTalkPage', true ); // from Parsoid's calls to the legacy parser for extension content parsing
} $pout->setExtensionData(
'DiscussionTools-isEmptyTalkPage',
count( $threadItems ) === 0
);
$threadsJSON = array_map( static function ( ContentThreadItem $item ) { $threadsJSON = array_map( static function ( ContentThreadItem $item ) {
return $item->jsonSerialize( true ); return $item->jsonSerialize( true );