mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Revert "Invert logic on empty talk page"
This reverts commit7e5f9b59a2
. Reason for revert: Causes empty state to always appear on wikis using Talkpageheader Bug: T373100 Change-Id: I23a3f937201d93c7c7645a09c4fccfcf1c14008a (cherry picked from commitf96eba7e6e
)
This commit is contained in:
parent
63937709e4
commit
4b6841562f
|
@ -410,8 +410,8 @@ class CommentFormatter {
|
|||
->addTrackingCategory( $pout, 'discussiontools-comments-before-first-heading-category', $title );
|
||||
}
|
||||
|
||||
if ( count( $threadItems ) > 0 ) {
|
||||
$pout->setExtensionData( 'DiscussionTools-isNotEmptyTalkPage', true );
|
||||
if ( count( $threadItems ) === 0 ) {
|
||||
$pout->setExtensionData( 'DiscussionTools-isEmptyTalkPage', true );
|
||||
}
|
||||
|
||||
$threadsJSON = array_map( static function ( ContentThreadItem $item ) {
|
||||
|
@ -926,7 +926,7 @@ class CommentFormatter {
|
|||
* HookUtils::shouldDisplayEmptyState which assures we have a talk page.
|
||||
*/
|
||||
public static function isEmptyTalkPage( ParserOutput $pout ): bool {
|
||||
return $pout->getExtensionData( 'DiscussionTools-isNotEmptyTalkPage' ) !== true;
|
||||
return $pout->getExtensionData( 'DiscussionTools-isEmptyTalkPage' ) === true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,7 +72,7 @@ class ParserHooks implements
|
|||
if ( $isPreview ) {
|
||||
$html = CommentFormatter::removeInteractiveTools( $html );
|
||||
// Suppress the empty state
|
||||
$pout->setExtensionData( 'DiscussionTools-isNotEmptyTalkPage', true );
|
||||
$pout->setExtensionData( 'DiscussionTools-isEmptyTalkPage', null );
|
||||
}
|
||||
|
||||
$pout->addModuleStyles( [ 'ext.discussionTools.init.styles' ] );
|
||||
|
|
|
@ -95,8 +95,8 @@ class CommentFormatterTest extends IntegrationTestCase {
|
|||
"hasLedeContent\n" : '' ) .
|
||||
( $pout->getExtensionData( 'DiscussionTools-hasCommentsInLedeContent' ) ?
|
||||
"hasCommentsInLedeContent\n" : '' ) .
|
||||
( $pout->getExtensionData( 'DiscussionTools-isNotEmptyTalkPage' ) ?
|
||||
'' : "isEmptyTalkPage\n" ) .
|
||||
( $pout->getExtensionData( 'DiscussionTools-isEmptyTalkPage' ) ?
|
||||
"isEmptyTalkPage\n" : '' ) .
|
||||
FormatJson::encode( $pout->getJsConfigVars(), "\t", FormatJson::ALL_OK ) .
|
||||
"\n</pre>";
|
||||
|
||||
|
|
Loading…
Reference in a new issue