Last modified: 2011-03-13 18:04:45 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 696 - Several files refer to namespaces by number instead of NS_MAIN, etc.
Several files refer to namespaces by number instead of NS_MAIN, etc.
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.3.x
All All
: Lowest trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2004-10-12 09:41 UTC by Leah
Modified: 2011-03-13 18:04 UTC (History)
0 users

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


Attachments

Description Leah 2004-10-12 09:41:56 UTC
Most of these assume the main namespace will always be 0.

Skin.php:1259:			if ( $ns != 0 AND $ns != 1 ) return '' ;
SpecialAllpages.php:115:	$sql = "SELECT cur_title FROM cur WHERE cur_namespace=0
AND cur_title >= '"
SpecialAncientpages.php:24:			WHERE cur_namespace=0 AND cur_is_redirect=0";
SpecialBooksources.php:46:			"WHERE cur_namespace=4 and cur_title='" .
SpecialLonelypages.php:22:			"WHERE l_to IS NULL AND cur_namespace=0 AND
cur_is_redirect=0";
SpecialLongpages.php:22:			WHERE cur_namespace=0 AND cur_is_redirect=0";
SpecialMaintenance.php:215:	  "WHERE cur_is_redirect=1 AND cur_namespace=0 AND
bl_from=cur_id " . 
SpecialMaintenance.php:311:			#$sql = "SELECT DISTINCT cur_title FROM cur WHERE
cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(cur_ind_text) AGAINST ('" .
wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
SpecialMaintenance.php:312:			$sql = "SELECT DISTINCT cur_title FROM
cur,searchindex WHERE cur_id=si_page AND cur_namespace=0 AND cur_is_redirect=0
AND (MATCH(si_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) .
"'))" ;
SpecialMaintenance.php:358:	  "WHERE cur_namespace=0 AND cur_is_redirect=0 " .
SpecialNewpages.php:32:			  AND rc_namespace=0 AND cur_is_redirect=0";
SpecialPopularpages.php:23:			WHERE cur_namespace=0 AND cur_is_redirect=0";
SpecialRandompage.php:21:		WHERE cur_namespace=0 AND cur_is_redirect=0 $extra
SpecialRecentchanges.php:49:	$sql = "SELECT cur_text FROM cur WHERE
cur_namespace=4 AND cur_title='Recentchanges'";
SpecialShortpages.php:26:			WHERE cur_namespace=0 AND cur_is_redirect=0";
SpecialUncategorizedpages.php:22:			"WHERE cl_from IS NULL AND cur_namespace=0
AND cur_is_redirect=0";
SpecialUndelete.php:128:		$log = wfGetSQL("cur", "cur_text", "cur_namespace=4
AND cur_title='".
SpecialWatchlist.php:143:		$z = "(wl_namespace=cur_namespace OR
wl_namespace+1=cur_namespace)";
Comment 1 Wil Mahan 2004-10-12 15:05:41 UTC
(In reply to comment #0)
> Most of these assume the main namespace will always be 0.

But the main namespace _is_ always 0, so it seems like a
non-issue to me. If you were to supply a patch against HEAD,
I doubt anyone would object to it, but I'm not sure it's
worth the effort.
Comment 2 Leah 2004-10-12 17:09:14 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Most of these assume the main namespace will always be 0.
> 
> But the main namespace _is_ always 0, so it seems like a
> non-issue to me. If you were to supply a patch against HEAD,
> I doubt anyone would object to it, but I'm not sure it's
> worth the effort.

It shouldn't be arbitrarily decided that namespace 0 can never be used for
anything else.  It may be the main article namespace on every Wikimedia site,
but somebody else might prefer a different namespace layout.  The direct
references to namespace 0 should be fixed before they lead to maintenance headaches.
Comment 3 Wil Mahan 2004-10-13 03:23:59 UTC
(In reply to comment #2)
> It shouldn't be arbitrarily decided that namespace 0 can never be used for
> anything else.  It may be the main article namespace on every Wikimedia site,
> but somebody else might prefer a different namespace layout.  The direct
> references to namespace 0 should be fixed before they lead to maintenance
headaches.

Would you mind making a patch for this?
Comment 4 Leah 2004-10-13 04:55:21 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > It shouldn't be arbitrarily decided that namespace 0 can never be used for
> > anything else.  It may be the main article namespace on every Wikimedia site,
> > but somebody else might prefer a different namespace layout.  The direct
> > references to namespace 0 should be fixed before they lead to maintenance
> headaches.
> 
> Would you mind making a patch for this?

I'd thought of it, but I'm not really familiar enough with all the code to be
certain I wouldn't inadvertently break something somewhere.
Comment 5 Antoine "hashar" Musso (WMF) 2005-01-11 18:15:11 UTC
I am making some changes in HEAD sources but it's probably not
worth it. People should not change the NS_MAIN value in defines.php
(I added a note about that).
Comment 6 Tim Starling 2005-05-14 12:48:28 UTC
I think we should use 0 as an alias for NS_MAIN wherever it is convenient. The
aim is to break enough things such that clueless users who think they can change
it will be discouraged quickly, rather than suffer a long and painful array of
minor bugs. Using NS_MAIN is useful for self-documentation, to indicate that the
zero is a namespace. It's not useful for flexibility.
Comment 7 Antoine "hashar" Musso (WMF) 2005-12-04 14:06:07 UTC
wont fix as per comment 5 & 6

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


Navigation
Links