Page MenuHomePhabricator

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:

Details

Reference
bz20040

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz20040.

Confirmed in Monobook with Chrome 2.

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

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

Attached:

fixed in r64672. thanks Derk-Jan.

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

For secure, just $wgRenderHashAppend would be enough.

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

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 ?

$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.

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.