mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Don't show empty page state on redirect pages"
This commit is contained in:
commit
a18c5c3e3a
|
@ -316,11 +316,11 @@ class HookUtils {
|
||||||
// Match the logic in MediaWiki core (as defined in SkinTemplate::buildContentNavigationUrlsInternal):
|
// Match the logic in MediaWiki core (as defined in SkinTemplate::buildContentNavigationUrlsInternal):
|
||||||
// https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/add6d0a0e38167a710fb47fac97ff3004451494c/includes/skins/SkinTemplate.php#1317
|
// https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/add6d0a0e38167a710fb47fac97ff3004451494c/includes/skins/SkinTemplate.php#1317
|
||||||
// * __NONEWSECTIONLINK__ is not present (OutputPage::forceHideNewSectionLink) and...
|
// * __NONEWSECTIONLINK__ is not present (OutputPage::forceHideNewSectionLink) and...
|
||||||
// - This is the current revision in a talk namespace (Title::isTalkPage) or...
|
// - This is the current revision of a non-redirect in a talk namespace or...
|
||||||
// - __NEWSECTIONLINK__ is present (OutputPage::showNewSectionLink)
|
// - __NEWSECTIONLINK__ is present (OutputPage::showNewSectionLink)
|
||||||
return (
|
return (
|
||||||
!static::hasPagePropCached( $title, 'nonewsectionlink' ) &&
|
!static::hasPagePropCached( $title, 'nonewsectionlink' ) &&
|
||||||
( ( $title->isTalkPage() && $output->isRevisionCurrent() ) ||
|
( ( $title->isTalkPage() && !$title->isRedirect() && $output->isRevisionCurrent() ) ||
|
||||||
static::hasPagePropCached( $title, 'newsectionlink' ) )
|
static::hasPagePropCached( $title, 'newsectionlink' ) )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,14 +204,15 @@ class PageHooks implements
|
||||||
$text, $lang
|
$text, $lang
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ( HookUtils::shouldDisplayEmptyState( $output->getContext() ) ) {
|
if (
|
||||||
if ( CommentFormatter::isEmptyTalkPage( $text ) ) {
|
CommentFormatter::isEmptyTalkPage( $text ) &&
|
||||||
$output->enableOOUI();
|
HookUtils::shouldDisplayEmptyState( $output->getContext() )
|
||||||
$text = CommentFormatter::appendToEmptyTalkPage(
|
) {
|
||||||
$text, $this->getEmptyStateHtml( $output->getContext() )
|
$output->enableOOUI();
|
||||||
);
|
$text = CommentFormatter::appendToEmptyTalkPage(
|
||||||
$output->addBodyClasses( 'ext-discussiontools-emptystate-shown' );
|
$text, $this->getEmptyStateHtml( $output->getContext() )
|
||||||
}
|
);
|
||||||
|
$output->addBodyClasses( 'ext-discussiontools-emptystate-shown' );
|
||||||
}
|
}
|
||||||
if ( HookUtils::isFeatureEnabledForOutput( $output, HookUtils::VISUALENHANCEMENTS ) ) {
|
if ( HookUtils::isFeatureEnabledForOutput( $output, HookUtils::VISUALENHANCEMENTS ) ) {
|
||||||
$output->enableOOUI();
|
$output->enableOOUI();
|
||||||
|
|
Loading…
Reference in a new issue