Page MenuHomePhabricator

Don't add new-talk div if there's not a new talk message
Closed, ResolvedPublic

Description

The div for the new talk message notification (newtalk) is always rendered, even when empty. This makes it difficult to style.

Refreshed.skin.php:

461			?>
462			<div id="new-talk">
463				<?php $this->html( 'newtalk' ) ?>
464			</div>

Wrap it in a conditional, as suggested in MediaWiki's skinning docs or as implemented in this skin for site notices, to avoid displaying it if the message is empty.

461			if ( $this->data['newtalk'] ) {
462			?>
463				<div id="new-talk">
464					<?php $this->html( 'newtalk' ) ?>
465				</div>
466			<?php
467			}
468			?>

Event Timeline

I'm wondering if this is ./includes/page/WikiPage.php or ./includes/skins/Skin.php or ./includes/user/User.php...

Sorry, not sure how this got into MW general. I filed it from and for the Refreshed skin project.

Change 328295 had a related patch set uploaded (by Jack Phoenix):
Only output div#new-talk when it makes sense

https://gerrit.wikimedia.org/r/328295

Change 328295 merged by jenkins-bot:
Only output div#new-talk when it makes sense

https://gerrit.wikimedia.org/r/328295

ashley claimed this task.
ashley removed a project: Patch-For-Review.
ashley subscribed.

Thanks, fixed.