Page MenuHomePhabricator

<br> appears without reason in #contentSub of wikis with FlaggedRevs enabled on that page
Closed, ResolvedPublic


<br> appears in #contentSub of several actions in Russian Wikipedia. This, in turn, produces several empty spaces in main and category namespaces (ones known yet).

Where bug happens:

  1. ‘History’ tab:Звёздные_войны&action=history
  2. ‘Page information’ of all articles, categories:Звёздные_войны&action=info
  3. ‘Purge cache’:Звёздные_войны&action=purge

The bug is not language-specific and isn’t influenced by any changed messages:Категория:Россия&action=info&uselang=qqx

Bug can’t be reproduced in same namespaces of English Wikipedia, even with Russian language for interface: (Russian)

Event Timeline

It is also present in German Wikipedia and not present in French. Please enwiki & frwiki teach us how you learned to avoid it.

Tracing where the contents of contentSub come from:

				<div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php
					$this->html( 'subtitle' )

'subtitle' is set here:

		$tpl->set( 'subtitle', $subpagestr . $out->getSubtitle() );

$subpagestr is empty unless a page has subpages, so only this part matters:

	public function getSubtitle() {
		return implode( "<br />\n\t\t\t\t", $this->mSubtitle );

mSubtitle is added to by:

	public function addSubtitle( $str ) {
		if ( $str instanceof Message ) {
			$this->mSubtitle[] = $str->setContext( $this->getContext() )->parse();
		} else {
			$this->mSubtitle[] = $str;

So, I suspect that something is calling addSubtitle() with either an empty string, or a message that ruwiki changes to be empty. (Note that if a message is shown in wiki content language, rather than user language, uselang=qqx will not reveal its message key.)

We could probably easily fix this by filtering out empty elements before calling implode(). But it would be good to find out first why an empty element is added, and whether that's intentional.

I can reproduce on enwiki too, but only for pages which have FlaggedRevs-based "pending changes" enabled, for example

Change 339821 had a related patch set uploaded (by Bartosz Dziewoński):
Don't add empty review notice to page subtitle (contentSub)

Jdforrester-WMF renamed this task from <br> appears without reason in #contentSub of Russian Wikipedia to <br> appears without reason in #contentSub of wikis with FlaggedRevs enabled on that page.Feb 27 2017, 6:37 PM
Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF assigned this task to matmarex.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF removed a project: Patch-For-Review.

Change 339821 merged by jenkins-bot:
Don't add empty review notice to page subtitle (contentSub)

This issue has been fixed and the fix will be deployed to Wikimedia wikis this week, 28 February – 2 March, per