Last modified: 2006-11-18 18:46:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 7972 - Language.php $fallback overridden without warning, comment
Language.php $fallback overridden without warning, comment
Product: MediaWiki
Classification: Unclassified
Documentation (Other open bugs)
All All
: Normal trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
  Show dependency treegraph
Reported: 2006-11-18 18:41 UTC by Edward Z. Yang
Modified: 2006-11-18 18:46 UTC (History)
0 users

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

Adds a short comment explaining the bheavior (409 bytes, patch)
2006-11-18 18:42 UTC, Edward Z. Yang
Fixes it without nuking tabs (354 bytes, patch)
2006-11-18 18:44 UTC, Edward Z. Yang

Description Edward Z. Yang 2006-11-18 18:41:29 UTC
I was puzzling over this segment of code for some time:

if ( $code != 'en' ) {
  $fallback = 'en';
} else {
  $fallback = false;

...wondering: "Hmm... doesn't that mean that English is the only possible
fallback language?" After all, looking at the immediately following code,
$fallback was not every set to a different value.

Then, it hit me: "Of course! This include did it:

  require( $filename );

$fallback was a variable in the actual file, so 'en' would get nicely
overwritten if necessary.

So... perhaps a short comment would help elucidate the meaning of that block for
anyone else who might have gotten confused. Patch coming.
Comment 1 Edward Z. Yang 2006-11-18 18:42:21 UTC
Created attachment 2733 [details]
Adds a short comment explaining the bheavior

Adds the comment "Default fallback, may be overridden when we include the
messages file" to the code in question.
Comment 2 Edward Z. Yang 2006-11-18 18:44:20 UTC
Created attachment 2734 [details]
Fixes it without nuking tabs

Whoops, murdered a few tabs. New and improved patch.
Comment 3 Rotem Liss 2006-11-18 18:46:18 UTC
Added in r17791.

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