Last modified: 2012-08-17 18:45:30 UTC
Title::getSubpages() does not consider whether the first letter of the Title is capitalized or not (also see Title::getUserCaseDBKey()) in case $wgCapitalLinks is set to false. If $wgCapitalLinks is false and the given title was created from a non-capitalized string, only subpages starting with a non-capitalized string should be returned I guess. Or am I getting the concept of $wgCapitalLinks and how non-capitalized titles are handled wrong somehow?
>If $wgCapitalLinks is false and the given title was created from a >non-capitalized string, only subpages starting with a non-capitalized string >should be returned I guess. Yes. Is that not the case? The code in question: 2724 $dbr = wfGetDB( DB_SLAVE ); 2725 $conds['page_namespace'] = $this->getNamespace(); 2726 $conds[] = 'page_title ' . $dbr->buildLike( $this->getDBkey() . '/', $dbr->anyString() ); getDBkey will return the title name with the first letter lowercase in the situation you describe above. Title::getUserCaseDBKey() is a really useless function that I'm not sure what the point of is. It will only differ from Title::getDBkey() in the case that $wgCapitalLinks is set to true.
I'm setting this bug worksforme. I didn't actually test though, so feel free to re-open
getDBkey() is using $mDbkeyform, which is capitalized, while $mUserCaseDBKey seems to be the only internal which holds the non-capitalized version. Debugging this to test my "Subpage Fun" extension right now and I set $wgCapitalLinks=false for the test (which works fine). There could be an issue there, but I don't think so. The real issue might be here: 3083 $this->mUserCaseDBKey = $dbkey; 3084 if ( $this->mInterwiki == '' ) { 3085 $dbkey = self::capitalize( $dbkey, $this->mNamespace ); 3086 } ... 3110 $this->mDbkeyform = $dbkey; It seems like the Title class ignores almost everything about $mUserCaseDBKey, it capitalizes the first letter in all functions but getUserCaseDBKey().
>getDBkey() is using $mDbkeyform, which is capitalized Only if $wgCapitalLinks is set to true. if $wgCapitalLinks is set to false, then getDBkey() is uncapatalized because Title::capitalize is a no-op in that case. See Title::capitalize
You are right Bawolff, in the meanwhile I figured that as well. There is something wrong elsewhere, might have to do with the parser test system after all. I'll report again later.
Alright, I think I put the pieces together and figured out the problem I am having. Has to do with the parser tests setup for articles. All articles are created with upper-case letters, the $wgCapitalLinks is temporarily overwritten during ParserTest::addArticle(). See Bug 39461 where I explain this issue in detail.