output of categorytree generates secure paths in rare cases.
Closed, ResolvedPublic

Description

returned json output

Ok, on http://en.wikipedia.org/wiki/Category:Scouting
I uncollapse the category: "People associated with Scouting (6)"

Now when i hover the subcat links, my status bar indicates "http://en.wikipedia.org/wikipedia/en/wiki/Category:Bronze_Wolf_awardees" Seems like it thinks it needs to use the secure server style for paths. The weird thing is that all the other subcategories of Scouting seem to uncollapse just just fine, with correct links.

Safari 4, Vector skin.

The request is:
http://en.wikipedia.org/w/index.php?action=ajax&rs=efCategoryTreeAjaxWrapper&rsargs[]=People_associated_with_Scouting&rsargs[]=%7B%22mode%22%3A%200%2C%20%22hideprefix%22%3A%2020%2C%20%22showcount%22%3A%20true%2C%20%22namespaces%22%3A%20false%7D&rsargs[]=json

The returned content is in the attachment.


Version: unspecified
Severity: normal

Attached: index.php

bzimport set Reference to bz20040.
TheDJ created this task.Via LegacyAug 2 2009, 2:40 PM
Chad added a comment.Via ConduitAug 2 2009, 2:42 PM

Confirmed in Monobook with Chrome 2.

TheDJ added a comment.Via ConduitMar 13 2010, 12:06 AM

In function ajax() of CategoryTree/CategoryTreeFunctions.php

Retrieve page_touched for the category

$dbkey = $title->getDBkey();

$mckey = "$wgDBname:categorytree(" . $this->getOptionsAsCacheKey( $depth ) . "):$dbkey";

Since the ajax results differ in secure vs. non-secure (localURL layout differs), the memcached is incorrectly shared between these ajax results, thus causing this problem

TheDJ added a comment.Via ConduitMar 13 2010, 12:53 AM

Created attachment 7194
expand the memcached key with variant/http values with getPageRenderingHash

Attached: categorytree.patch

daniel added a comment.Via ConduitApr 6 2010, 9:47 PM

fixed in r64672. thanks Derk-Jan.

Platonides added a comment.Via ConduitOct 10 2010, 2:12 PM

What do you mean with 'variant options'? $wgLang->getCode() ?

For secure, just $wgRenderHashAppend would be enough.

Platonides added a comment.Via ConduitOct 10 2010, 2:18 PM

$wgContLang->getExtraHashOptions() . $wgRenderHashAppend would be enough, right?

TheDJ added a comment.Via ConduitOct 17 2010, 11:27 AM

Variant options means zh-tw vs. zh-hs etc. Tim told me to use getPageRenderingHash() back then. I'm not sure if $wgRenderHashAppend takes user variants into account. Perhaps you should raise this in code comments if you really want it to be reviewed again ?

Platonides added a comment.Via ConduitOct 17 2010, 2:21 PM

$wgContLang->getExtraHashOptions() contain the preferred language variant.

I'm not sure which CR would be appropiate for that. It was right back then. Now, I am trying to deprecate getPageRenderingHash() per r70783#c9984.

I think I will change it.

TheDJ added a comment.Via ConduitOct 17 2010, 2:51 PM

I guess $wgContLang->getExtraHashOptions (for variant) and $wgRenderHashAppend (for secure) combined should do the trick. If you think that is better, then you should go right ahead.

Platonides added a comment.Via ConduitOct 17 2010, 5:29 PM

Thanks. Done in r74903.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.