Page MenuHomePhabricator

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

Description

<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: https://ru.wikipedia.org/w/index.php?title=Звёздные_войны&action=history
  2. ‘Page information’ of all articles, categories: https://ru.wikipedia.org/w/index.php?title=Звёздные_войны&action=info
  3. ‘Purge cache’: https://ru.wikipedia.org/w/index.php?title=Звёздные_войны&action=purge

The bug is not language-specific and isn’t influenced by any changed messages:
https://ru.wikipedia.org/w/index.php?title=Категория:Россия&action=info&uselang=qqx

Bug can’t be reproduced in same namespaces of English Wikipedia, even with Russian language for interface:
https://en.wikipedia.org/w/index.php?title=Star_Wars&action=info
https://en.wikipedia.org/w/index.php?title=Category:Russia&action=info&uselang=ru (Russian)

Details

Related Gerrit Patches:
mediawiki/extensions/FlaggedRevs : masterDon't add empty review notice to page subtitle (contentSub)

Event Timeline

stjn created this task.Feb 25 2017, 10:35 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 25 2017, 10:35 AM

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:

[mediawiki/skins/Vector]/VectorTemplate.php
				<div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php
					$this->html( 'subtitle' )
				?></div>

'subtitle' is set here:

[mediawiki/core]/includes/skins/SkinTemplate.php
		$tpl->set( 'subtitle', $subpagestr . $out->getSubtitle() );

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

[mediawiki/core]/includes/OutputPage.php
	public function getSubtitle() {
		return implode( "<br />\n\t\t\t\t", $this->mSubtitle );
	}

mSubtitle is added to by:

[mediawiki/core]/includes/OutputPage.php
	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.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptFeb 25 2017, 11:56 AM

I can reproduce on enwiki too, but only for pages which have FlaggedRevs-based "pending changes" enabled, for example https://en.wikipedia.org/w/index.php?title=Linux&action=info.

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

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

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)

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

This issue has been fixed and the fix will be deployed to Wikimedia wikis this week, 28 February – 2 March, per https://www.mediawiki.org/wiki/MediaWiki_1.29/Roadmap.