Jack Phoenix has uploaded a new change for review. https://gerrit.wikimedia.org/r/235452
Change subject: Version 3.3.1: don't show the "discuss" link on embedded polls when $wgPollDisplay['comments'] = false; ...................................................................... Version 3.3.1: don't show the "discuss" link on embedded polls when $wgPollDisplay['comments'] = false; If a page embeds a poll with the <pollembed> tag and a user has already voted in the poll, the "Discuss" link would show up irregardless of the $wgPollDisplay['comments'] setting, which was silly, because commenting on polls is disabled by default and requires the Comments ext. to be installed. Reported on MediaWiki.org by BradLeeBH: https://www.mediawiki.org/w/index.php?title=Extension_talk:PollNY&oldid=1870956#BUG:_Discuss_textlink_still_shows_on_an_embeded_page_when_using_.3Cpollembed.3E Change-Id: I0f5561b8db3d54f622d2ec00dffa0897b6be91bb --- M PollNY.php M PollNYHooks.php 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY refs/changes/52/235452/1 diff --git a/PollNY.php b/PollNY.php index bf12944..e502629 100644 --- a/PollNY.php +++ b/PollNY.php @@ -17,7 +17,7 @@ $wgExtensionCredits['other'][] = array( 'path' => __FILE__, 'name' => 'PollNY', - 'version' => '3.3', + 'version' => '3.3.1', 'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ), 'descriptionmsg' => 'poll-desc', 'url' => 'https://www.mediawiki.org/wiki/Extension:PollNY' diff --git a/PollNYHooks.php b/PollNYHooks.php index ff125ec..8855168 100644 --- a/PollNYHooks.php +++ b/PollNYHooks.php @@ -189,7 +189,7 @@ public static function renderEmbedPoll( $input, $args, $parser ) { $poll_name = $args['title']; if( $poll_name ) { - global $wgOut, $wgUser, $wgExtensionAssetsPath; + global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgPollDisplay; // Load CSS for non-Monaco skins - Monaco's ny.css already contains // PollNY's styles (and more) @@ -287,8 +287,10 @@ 'poll-based-on-votes', $poll_info['votes'] )->parse() . ')</div>'; - $output .= '<div><a href="' . htmlspecialchars( $poll_title->getFullURL() ) . '">' . - wfMessage( 'poll-discuss' )->text() . '</a></div>'; + if ( isset( $wgPollDisplay['comments'] ) && $wgPollDisplay['comments'] ) { + $output .= '<div><a href="' . htmlspecialchars( $poll_title->getFullURL() ) . '">' . + wfMessage( 'poll-discuss' )->text() . '</a></div>'; + } $output .= '<div class="poll-timestamp">' . wfMessage( 'poll-createdago', Poll::getTimeAgo( $poll_info['timestamp'] ) )->parse() . '</div>'; -- To view, visit https://gerrit.wikimedia.org/r/235452 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f5561b8db3d54f622d2ec00dffa0897b6be91bb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PollNY Gerrit-Branch: master Gerrit-Owner: Jack Phoenix <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
