Last modified: 2013-12-19 22:40:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45205, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43205 - Content/User language mix ups leading to visual distortion
Content/User language mix ups leading to visual distortion
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://translatewiki.net/wiki/User:A...
:
Depends on:
Blocks: 39480
  Show dependency treegraph
 
Reported: 2012-12-17 18:39 UTC by Siebrand Mazeland
Modified: 2013-12-19 22:40 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Detail of https://translatewiki.net/wiki/User:Aaron_Schulz?action=purge (92.77 KB, image/png)
2012-12-17 18:39 UTC, Siebrand Mazeland
Details
Detail of https://translatewiki.net/wiki/User:Aaron_Schulz?uselang=en (90.30 KB, image/png)
2012-12-17 18:40 UTC, Siebrand Mazeland
Details
Detial of https://translatewiki.net/wiki/User:Aaron_Schulz as anonymous user (71.14 KB, image/png)
2012-12-17 18:40 UTC, Siebrand Mazeland
Details

Description Siebrand Mazeland 2012-12-17 18:39:05 UTC
Created attachment 11528 [details]
Detail of https://translatewiki.net/wiki/User:Aaron_Schulz?action=purge

Some weirdness in content language vs. user language and the cache being polluted because of it.

I'll try to describe everything involved as well as possible, and I have no idea of the root cause (hence the bug report :P).

Steps to reproduce:
1. Be logged in on translatewiki.net
2. Set Dutch as user language
3. Go to https://translatewiki.net/wiki/User:Aaron_Schulz?action=purge
4. Put the mouse pointer over the column header "Modification date".

Observed: A pop-up is shown in Dutch (see screenshot "UILang-nl-purged.png").

5. Go to https://translatewiki.net/wiki/User:Aaron_Schulz?uselang=en

Observed: No pop-up is available like in step 4. Instead, the coloumn header now reads "Modification dateDit is een speciale eigenschap in de wiki." (see screenshot "UILang-nl-uselang-en.png"

6. Go to https://translatewiki.net/wiki/User:Aaron_Schulz while logged out.

Observed: Same behaviour as in step 5. (screenshot "Anonymous.png").
Comment 1 Siebrand Mazeland 2012-12-17 18:40:08 UTC
Created attachment 11529 [details]
Detail of https://translatewiki.net/wiki/User:Aaron_Schulz?uselang=en
Comment 2 Siebrand Mazeland 2012-12-17 18:40:41 UTC
Created attachment 11530 [details]
Detial of https://translatewiki.net/wiki/User:Aaron_Schulz as anonymous user
Comment 3 MWJames 2012-12-17 20:14:59 UTC
translatewiki uses SMW 1.9 alpha, the Highlighter class (Introduced in 1.9 which prepares the tooltip content) is using the ContextSource to determine language and output.

## Display/non-display issue 

The problem is a missing resource ('ext.smw.tooltips'). 

The display/non-display issue of the tooltip relates to the problem that the resource that is responsible 'ext.smw.tooltips' is registered through the context object $this->getOutput()->addModules( 'ext.smw.tooltips' ); but that only works for pages that are refreshed or newly created but unfortunately when a page comes from the parser cache the resource is not registered any longer (this can be checked by looking at the page source).

A workaround is to replace the  $this->getOutput()->addModules( 'ext.smw.tooltips' ) line in Highlighter class with SMWOutputs::requireResource( 'ext.smw.tooltips' ); (this way the resource is kept as static property and called through every page processing stage such as refresh, purge etc.)

## User language/content language

As for the second problem of user language/content language, the Highlighter class only receives the content for a particular object (property, warning etc.) which means that the content provider (from where the Highlighter class is called) probably "sends" an inappropriate translated text. 

I haven't checked it but because "Modification date" is a special property the SMWPropertyValue class should make the call when setting the content.

$highlighter->setContent( array (
'caption' => $text,
'content' => wfMessage( 'smw_isspecprop' )->text()
) );

## Misc

I would appreciate an insight as to why ... getOutput()->addModules( ... ) (by using the ContextSource) only works for newly/purged pages and not for pages that are coming from the parser cache.

Besides that, I'm short-staffed at the moment that's why I don't really have the time to drill on these issues (and since it is not an official release yet I have no rush either), so anyone with some spare time please go ahead.
Comment 4 MWJames 2012-12-29 05:05:15 UTC
A temporary fix [1] for the display/non-display issue has been provided

[1] https://gerrit.wikimedia.org/r/#/c/41202/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links