Page MenuHomePhabricator

Tooltip "page does not exist" for red links is displayed in interface language of the last user who edited the page
Closed, ResolvedPublic

Description

I. How to reproduce the issue:

  1. Switch your interface language to A (where A is a language different from the default language of this wiki).
  2. Edit any page that has a redlink.
  3. Logout. Open the page you just edited and put a mouse over the redlink.

The tooltip will be shown in language A.
But it must be shown in the default language of this wiki.

II. Impact: foreign interwiki bots change tooltips on every article they touch.

III. Possible cause: this interface message is somehow cached improperly. action=purge restores the correct value.


Version: 1.24rc
Severity: normal

Details

Reference
bz69905

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:35 AM
bzimport set Reference to bz69905.
bzimport added a subscriber: Unknown Object (MLST).

The interface message in question is [[MediaWiki:Red-link-title]]

Suggested fix.

diff -up a/Linker.php b/Linker.php

  • a/Linker.php 2014-08-22 19:25:52.676415475 +0400

+++ b/Linker.php 2014-08-22 19:25:52.255413597 +0400
@@ -345,7 +345,7 @@ class Linker {

		} elseif ( in_array( 'known', $options ) ) {
			$defaults['title'] = $target->getPrefixedText();
		} else {
  • $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() )->text();

+ $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() )->inContentLanguage()->text();

		}

		# Finally, merge the custom attribs with the default ones, and iterate

Thanks for taking the time to report this and investigating!

If you feel like cooking a patch, you are welcome to use Developer access

https://www.mediawiki.org/wiki/Developer_access

to submit this as a Git branch directly into Gerrit:

https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Thanks again!

This is a vexata quaestio; several attempts were made and failed.

  • This bug has been marked as a duplicate of bug 32686 ***