Last modified: 2007-01-28 08:36:16 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 T9491, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7491 - Namespaces does not resolved for languages with variants
Namespaces does not resolved for languages with variants
Status: CLOSED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.8.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 6706
  Show dependency treegraph
 
Reported: 2006-10-04 16:36 UTC by AlefZet
Modified: 2007-01-28 08:36 UTC (History)
0 users

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


Attachments
httpd.conf (34.06 KB, text/plain)
2006-10-05 11:33 UTC, AlefZet
Details
php.ini (46.40 KB, text/plain)
2006-10-05 11:35 UTC, AlefZet
Details
LocalSettings.php (4.68 KB, text/plain)
2006-10-05 11:42 UTC, AlefZet
Details
my.ini (8.88 KB, text/plain)
2006-10-05 11:45 UTC, AlefZet
Details
Patch for Language.php (560 bytes, patch)
2006-10-07 16:15 UTC, AlefZet
Details

Description AlefZet 2006-10-04 16:36:20 UTC
After installing current MW 1.8-svn on localhost with config for multi-variant languages ('kk' or 'sr', 
and probably 'zh'), links to pages in namespaces other of {{ns:0}} does not work (still in red). 
English canonical names resolved only. I guess it is because improperly handled instructions for 
conversion to lowercase letters. Is it valid?
Comment 1 Brion Vibber 2006-10-04 16:39:22 UTC
Do you *guess* this because you *tested* it or did you *guess* it *randomly*?

Please provide some examples, and details of your configuration.
Is PHP's mbstring extension installed or not?
Comment 2 AlefZet 2006-10-04 16:56:18 UTC
(In reply to comment #1)
> Do you *guess* this because you *tested* it or did you *guess* it *randomly*?
It is *guess* only. It isn't tested.

> Please provide some examples, and details of your configuration.Is PHP's mbstring extension 
installed or not?
Yes, it is PHP5 with some built-in extensions like iconv, mbstring etc. And ran under Windows XP
Comment 3 Brion Vibber 2006-10-04 18:36:11 UTC
Links appear to work just fine with sr. Resolving WORKSFORME.
If problems continue, please:

1) Ensure you have updated everything -- many files were moved in the last day.
2) Provide *exact* examples of links which should work and *exact* descriptions of how they 
fail.
3) Provide details of configuration to go with these examples.
Comment 4 AlefZet 2006-10-05 11:33:51 UTC
Created attachment 2451 [details]
httpd.conf

Apache 1.3.33 (Windows)
Comment 5 AlefZet 2006-10-05 11:35:38 UTC
Created attachment 2452 [details]
php.ini

PHP 5.1.4.4 enabled as module for Apache
Comment 6 AlefZet 2006-10-05 11:42:56 UTC
Created attachment 2453 [details]
LocalSettings.php

MW 1.8alpha (r16781) from SVN. Always is synchronised with svn, only
LanguagesXx.php and MessagesXx.php files for Kazakh variants is my own. Without
any cache managers.
Comment 7 AlefZet 2006-10-05 11:45:02 UTC
Created attachment 2454 [details]
my.ini

MySQL 4.1.19
Comment 8 AlefZet 2006-10-05 12:03:06 UTC
If I remove localised $namespaceNames or change to English canonical names, everything works.
If apply localised $namespaceNames, all links out main namespace (ns:0) is red.
If I remove LanguageXx.php and MessagesXx.php files for Kazakh (or Serbian) variants and use only 
one LanguageXx.php and MessagesXx.php (eg MessagesKk_kz.php to MessagesKk.php with exact content) 
everything works as expected.
Yes, I know live sr wiki works normally. The trouble is with svn files. May be all svn version files 
not yet installed on live sr wiki?
Comment 9 AlefZet 2006-10-05 12:12:15 UTC
(In reply to comment #8)
> If I remove localised $namespaceNames or change to English canonical names, everything works.If 
It is for default variant (kk-kz or sr-ec), changes for slave variants (kk-cn, kk-tr or sr-el) 
haven't effect.
Comment 10 AlefZet 2006-10-05 12:23:52 UTC
One test: I change in $namespaceNames to NS_SPECIAL => 'Speçial' (change letter 'c' to 'ç') result 
red links. Appears all non-English letters ignored in namespaces.
Comment 11 Brion Vibber 2006-10-05 18:58:44 UTC
You still provide no examples of links that would fail.

Please provide this most basic of information!
You MUST provide exact steps to reproduce the problem!
Comment 12 AlefZet 2006-10-05 23:24:20 UTC
(In reply to comment #11)
> You still provide no examples of links that would fail.Please provide this most basic of 
information!You MUST provide exact steps to reproduce the problem!

Finally I got solution
In Language.php currently is a function getNsIndex:

	function getNsIndex( $text ) {
		$this->load();
		$index = @$this->mNamespaceIds[$this->lc($text)];
		if ( is_null( $index ) ) {
			return false;
		} else {
			return $index;
		}
	}

I revert this code to 1.6.7 version:

 	function getNsIndex( $text ) {
		$ns = $this->getNamespaces();

		foreach ( $ns as $index => $name ) {
			if ( strcasecmp( $name, $text ) == 0)
				return $index;
		}
		return false;
	}

Immediately everything works fine.
Comment 13 AlefZet 2006-10-07 13:59:21 UTC
What about commit the fixed code (See [http://bugzilla.wikimedia.org/show_bug.cgi?id=7491#c12]) to 
SVN?
Comment 14 Jimmy Collins 2006-10-07 15:41:17 UTC
Please post patches as attachmanet in unified format (diff -u) - makes it much
easier to handle them. Thanks!
Comment 15 AlefZet 2006-10-07 16:15:08 UTC
Created attachment 2476 [details]
Patch for Language.php
Comment 16 Brion Vibber 2006-10-09 02:22:23 UTC
1) THERE IS STILL NO EXAMPLE OF WHAT FAILS.
THIS MEANS WE CANNOT VERIFY THE PROBLEM OR
TEST A FIX.

NOTHING WILL HAPPEN SINCE YOU CANNOT PROVIDE
THIS.

RESOLVING AS WORKSFORME.

2) The given patch looks like it would certainly
fail for non-ASCII chars in most circumstances,
since it *removes* code which tries to do the
case-insensitive compare in a compatible way,
reverting it to a strcasecmp which will usually
fail for non-ASCII chars.
Comment 17 AlefZet 2006-10-09 06:12:57 UTC
1) *all* links out main namespace (ns:0) is *red*
if you install wiki selecting 'sr' as default, click for example to 'Посебне странице' on sidebar or 
http://localhost/wiki/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Specialpages on address bar in 
browser. Tell me what will happen, just me look message 'Тренутно нема текста на овој страници. 
Можете претражити овај назив у осталим страницама или уредити ову страницу.' what is 
message 'noarticletext'
2) strcasecmp works as expected for non-ASCII chars

array mNamespaceIds with non-ASCII string as key, always is *empty*, than is_null( $index ) always 
is NULL
Comment 18 Brion Vibber 2006-10-09 06:18:20 UTC
1) Cannot reproduce. These links are not red, and they do work. Посебно:Specialpages 
and Посебно:Recentchanges work as expected.

2) Please provide steps to reproduce.
Comment 19 AlefZet 2006-10-14 10:46:42 UTC
After reinstalling PHP I notice what the bug reproduced contineously in php 5.1.2 win32 only. In 
current 5.1.6 works as expected. If You will *exactly* reproduce my configuration (see above) You 
will see what happens.
Comment 20 Brion Vibber 2006-10-14 16:35:18 UTC
Please check with 1.8.2, I suspect you'll find that the issue is resolved.
This looks like the same as bug 7562.
Comment 21 AlefZet 2006-10-14 17:08:28 UTC
I already had 1.9. 
Yes, I think too this is the same as 7562. 
I notice Title.php updated one day ago, than may be it is not PHP itself. But you may troubles with 
function lc() for turkic letter pairs İi and Iı (dotted and undotted uppercase/lowercase). 
It should have rezult

lc('İ') -> i and lc('I') -> ı

See also comments for [[bug 4379]]

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


Navigation
Links