Page MenuHomePhabricator

InputBox using interface language in parser hook causing cache pollution.
Open, Needs TriagePublic

Description

This edit https://commons.wikimedia.org/w/index.php?title=Commons:Administrators%27_noticeboard&diff=next&oldid=301426677 has somehow changed the search button's text from "Search full text" to "Szukaj w całych tekstach". I can find no reason why that would be, and the template being transcluded (https://commons.wikimedia.org/wiki/Template:Administrators%27_noticeboard) has not changed.

I have tested logged in and logged out with Chrome and Firefox, monobook and default, and have tried https://commons.wikimedia.org/wiki/Commons:Administrators'_noticeboard?uselang=en with all of the above.

Event Timeline

OK... this is no longer happening. I have literally no idea what went on there, but am attaching screenshots of two still-open tabs to verify I haven't gone mad. In the diff, clicking previous diff would show it in English, then clicking next would show it in Polish.

polish search.png (669×1 px, 87 KB)

polish search2.png (939×1 px, 95 KB)

Aklapper renamed this task from Polish language showing up for no reason to Search button on Commons Administrators' noticeboard in Polish language for no reason.May 16 2018, 10:50 AM

This is currently happening again, this time in Chinese, and the last person who edited has a Chinese username.
https://commons.wikimedia.org/w/index.php?title=Commons:Administrators%27_noticeboard/User_problems&diff=next&oldid=303908227

On the previous diff, where User:廣九直通車 did not sign, the search box is in English.... but I anticipate that this will disappear again, even from the diff (!) once someone else edits the page, as it did last time with Ankry.

new error.png (1×1 px, 127 KB)

Storkk renamed this task from Search button on Commons Administrators' noticeboard in Polish language for no reason to Search button on Commons Administrators' noticeboard changes language depending on last user's signature.May 31 2018, 9:07 AM

... actually this has disappeared without an intervening edit to the page.

Storkk renamed this task from Search button on Commons Administrators' noticeboard changes language depending on last user's signature to Search button on Commons Administrators' noticeboard ephemerally changes language depending on last user's signature.May 31 2018, 9:21 AM

Now in German, presumably because User:Sänger is the last editor of the page.

now in german.png (917×1 px, 83 KB)

So i get the german search box, and the cache key is:

Saved in parser cache with key commonswiki:pcache:idhash:1067011-0!canonical and timestamp 20180610140040 and revision id 305638763

Which is odd.

So something is using interface language when it should be using canonical language.

<inputbox>
bgcolor           = transparent
type              = fulltext
namespaces        = Commons
prefix            = Commons:Administrators' noticeboard
break             = no
width             = 50
placeholder       = {{LangSwitch|en=Search in all administrators' noticeboard archives|fa=جستجو در همهٔ بایگانی‌های تابلوی اعلانات|sv=Sök i alla arkiv|fi=Etsi ilmoitustaulun arkistosta|ja=全伝言板倉庫検索|ko=모든 관리자 요청 보존문서 찾기|pt=Pesquisar em todos os arquivos|uk=Шукати в усіх архівах дощок для оголошень|zh-hans=搜索所有管理员通知栏档案}}
searchbuttonlabel = <!-- &#x1F50D; not very public unicode -->
</inputbox>

So it looks like its using the default for the search button. So its probably a bug in the extension that generates that label.

yeah,

line 138:
$this->mSearchButtonLabel = wfMessage( 'inputbox-searchfulltext' )->text();

It should be
$this->mSearchButtonLabel = wfMessage( 'inputbox-searchfulltext' )->inContentLanguage()->text();

And ditto for a bunch of other messages

Bawolff renamed this task from Search button on Commons Administrators' noticeboard ephemerally changes language depending on last user's signature to InputBox using interface language in parser hook causing cache pollution..Jun 10 2018, 2:12 PM

We generally use inContentLanguage() for configuration messages which are not supposed to be translated.

We generally use inContentLanguage() for configuration messages which are not supposed to be translated.

Well we also use it for things that get embedded in pages since page content is assumed to stay constant for different users (an assumption which admittedly makes about no sense on commons, but its pretty ingrained in mediawiki at this point)

The ideal case is to actually use ->inLanguage() feeding it the language from the ParserOptions object.

Vvjjkkii renamed this task from InputBox using interface language in parser hook causing cache pollution. to svcaaaaaaa.Jul 1 2018, 1:09 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from svcaaaaaaa to InputBox using interface language in parser hook causing cache pollution..Jul 2 2018, 4:07 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Change 758950 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/InputBox@master] Inputbox labels should be in content language

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

TheDJ removed TheDJ as the assignee of this task.Jan 26 2024, 2:27 PM