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


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:

The returned content is in the attachment.

Version: unspecified
Severity: normal

Attached: index.php


TheDJ created this task.Aug 2 2009, 2:40 PM
demon added a comment.Aug 2 2009, 2:42 PM

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: categorytree.patch

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

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.

TheDJ added a comment.Oct 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.

Thanks. Done in r74903.

Add Comment