Page MenuHomePhabricator

The messages Wikibase-validator-sitelink-conflict and Wikibase-undo-title show HTML when used as an error after trying to reset an item page
Closed, ResolvedPublic1 Estimated Story Points

Description

A user wrongly removed many sitelinks from an item page. I went to the item page's history and clicked on a good previous version. When I tried to reset the item page to that version, I got a page that showed Wikibase-validator-sitelink-conflict as an error message. All the links appeared as HTML - for example "<a class="external text" href="//en.wikipedia.org/wiki/Missa_solemnis_(Beethoven)">enwiki:Missa solemnis (Beethoven)</a>" instead of "enwiki:Missa solemnis (Beethoven)" as a clickable hyperlink.

The title of the page was the message Wikibase-undo-title, and it showed "$1" instead of the item's label.

My UI language is Hebrew.

The item I was trying to restore is https://www.wikidata.org/wiki/Q723790 .

The version I was trying to restore is https://www.wikidata.org/w/index.php?title=Q723790&oldid=123262931 .

Event Timeline

Amire80 raised the priority of this task from to Needs Triage.
Amire80 updated the task description. (Show Details)
Amire80 added a subscriber: Amire80.
Lydia_Pintscher added a project: Wikidata.
Lydia_Pintscher set Security to None.
Lydia_Pintscher added a subscriber: hoo.

Can confirm this, can somebody fix this? This is a crucial part of the interface, especially for new users.

Change 192344 had a related patch set uploaded (by Hoo man):
Don't implicitly parse messages passed to OutputPage::addWikiText

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

Patch-For-Review

Change 192344 merged by jenkins-bot:
Don't implicitly parse messages passed to OutputPage::addWikiText

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

hoo claimed this task.

Can confirm this, can somebody fix this? This is a crucial part of the interface, especially for new users.

Done ;)

Change 192364 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fix broken undo error message

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

Patch-For-Review

The headline is still displaying an $1. Fixed in my patch.

Change 192598 had a related patch set uploaded (by Hoo man):
Don't implicitly parse messages passed to OutputPage::addWikiText

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

Patch-For-Review

Change 192364 merged by jenkins-bot:
Fix broken undo error message

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

Change 192598 merged by jenkins-bot:
Don't implicitly parse messages passed to OutputPage::addWikiText

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

The heading has indeed been fixed, however I can still see HTML in the error message.

Taken from https://www.wikidata.org/w/index.php?title=Q408110&action=edit&restore=214635733

bug.jpg (473×1 px, 126 KB)

thiemowmde added a project: patch-welcome.

The HTML code is still in the message:

T85340.png (322×661 px, 30 KB)

Can this problem solved by replacing in EditEntityAction.php:

$this->getOutput()->addWikiText( $status->getMessage()->text() );

by

$this->getOutput()->addHTML( $status->getMessage()->escaped() );

Change 224972 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Do not show raw HTML in EditEntityAction::showUndoErrorPage

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

Addshore claimed this task.

Change 224972 merged by jenkins-bot:
Do not show raw HTML in EditEntityAction::showUndoErrorPage

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