Commit graph

132 commits

Author SHA1 Message Date
Sam Reed
f980fa58a1 Swap @private for setting function definition to private 2010-12-05 16:15:28 +00:00
Sam Reed
ec35a2b39f Change some member calls to static, from r75709 2010-12-05 16:08:12 +00:00
Sam Reed
7320879184 Few braces and spaces
Fixing up documentation
2010-11-30 19:06:28 +00:00
Max Semenik
b6dd68fcc2 Fix bug caused by variable reuse from r71902 2010-11-02 15:52:10 +00:00
Sam Reed
51abde1a00 Mark a few more methods static
Seems I forgot to commit this
2010-10-30 21:31:22 +00:00
Chad Horohoe
e92035acf8 (bug 25087) Fix fatal in CategoryPage 2010-09-08 10:41:13 +00:00
Platonides
a4349f55ee Follow up r36814. Make the deprecated function call the non-deprecated one instead of the other way around. 2010-09-04 18:46:18 +00:00
Aryeh Gregor
95d7572403 Fix category count when category table out of sync
This should fix a regression from my category sort work, caused by not
accounting for the the fact that $this->from and $this->until were
changed to arrays.  Wrong counts for the number of pages in the category
might have been displayed in some cases.
2010-08-29 21:21:57 +00:00
Aryeh Gregor
3494f65100 Save 200 useless queries per category page view
Yeah, I kind of wish this was a joke.  Granted, they're extremely fast
queries, and maybe they don't happen on all configs, but still.  And I'm
still seeing 148 queries per view, mostly Revision::fetchFromConds() . . .
2010-08-16 21:37:17 +00:00
Alexandre Emsenhuber
7b79d94515 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-14 17:42:40 +00:00
Aryeh Gregor
4bad1ed088 Fix extensions to work with category sort changes
Three different extensions were copy-pasting all of
CategoryPage::closeShowCategory() just to change which CategoryViewer
descendant was used.  I changed the base class to use a member variable
for the CategoryViewer class, so this reduces code duplication too.  I
only tested this on CategoryTree; MetavidWiki is certainly still broken,
from the looks of it (assumes $this->from is a string), but
PeopleCategories might be okay.  Hard to avoid breaking extensions with
this sort of schema/index change.
2010-08-13 22:07:48 +00:00
Platonides
37c7dd7c2b Hacky r70418 makes this global unused. 2010-08-12 14:34:39 +00:00
Aryeh Gregor
1dd0888ea9 Clean up code now that the old path is gone 2010-08-03 20:50:58 +00:00
Aryeh Gregor
f5c6e4811f Don't duplicate the "title" query parameter
Kind of hacky to just unset this one parameter, but it's what Pager.php
does.
2010-08-03 20:50:52 +00:00
Aryeh Gregor
36e343cba9 Fix bug in sorting due to $wgRequest eating nulls
I'll fix this up so that the query string looks nicer later.  Embedding
nulls in query strings is not a great idea.
2010-08-03 20:50:46 +00:00
Aryeh Gregor
7ec501be6a Enable new category sort by default
Patch best viewed with whitespace changes ignored.  This will doubtless
introduce a bunch of bugs.  Please report any so I can fix them.  If
they're big enough and the fix isn't obvious, please revert.
2010-08-03 20:50:01 +00:00
Platonides
eee4d13325 Check the link color (stub, redirect) on just one place.
Deprecate makeSizeLinkObj. The only usage is in CategoryPage, which we can change to link() without penalty, since the created Title is already loaded with its length.
2010-08-02 15:53:22 +00:00
Alexandre Emsenhuber
30ff5dea81 Fixed some doxygen warnings 2010-08-01 19:39:57 +00:00
Platonides
e12e9a6233 Unused global. 2010-07-27 12:20:22 +00:00
Aryeh Gregor
2ffa5e4876 Fix bug in prefixing scheme
As Bawolff pointed out at [[mw:User talk:Simetrical/Collation]], the
prefixing scheme I was using meant that the page "Z" with sort key of
"F" would sort after a page named "A" with a sort key of "FF", since the
first one's raw sort key would compute to "FZ", and the second's would
compute to "FFA".  I've fixed this by separating the prefix from the
unprefixed part by a null byte (cl_sortkey is eventually going to be
totally binary anyway, may as well start now).
2010-07-26 22:04:19 +00:00
Aryeh Gregor
98a7f4d756 Paginate the three category sections separately
This fully fixes bug 1211.  It might be buggy, and
$wgExperimentalCategorySort sure makes it hackish.  I should definitely
have gone with some kind of branch here.  More testing would be good.
Also, the UI could use improvement (extra ugly next/previous 200 links
in various places).
2010-07-26 21:27:07 +00:00
Aryeh Gregor
022b7ba140 Reconcept cl_raw_sortkey as cl_sortkey_prefix
In response to feedback by Phillipe Verdy on bug 164.  Now if a bunch of
pages have [[Category:Foo| ]], they'll sort amongst themselves according
to page name, instead of in basically random order as it is currently.
This also makes storage more elegant and intuitive: instead of giving
NULL a magic meaning when there's no custom sortkey specified, we just
store an empty string, since there's no prefix.

This means {{defaultsort:}} really now means {{defaultsortprefix:}},
which is slightly confusing, and a lot of code is now slightly
misleading or poorly named.  But it should all work fine.

Also, while I was at it, I made updateCollation.php work as a transition
script, so you can apply the SQL patch and then run updateCollation.php
and things will work.  However, with the new schema it's not trivial to
reverse this -- you'd have to recover the raw sort keys with some PHP.
Conversion goes at about a thousand rows a second for me, and seems to
be CPU-bound.  Could probably be optimized.

I also adjusted the transition script so it will fix rows with collation
versions *greater* than the current one, as well as less.  Thus if some
site wants to use their own collation, they can call it 137 or
something, and if they later want to switch back to MediaWiki stock
collation 7, it will work.

Also fixed a silly bug in updateCollation.php where it would say "1000
done" if it did nothing, and changed $res->numRows() >= self::BATCH_SIZE
to == so people don't wonder how it could be bigger (since it can't, I
hope).
2010-07-26 19:27:13 +00:00
Sam Reed
d3f2b9a2c5 Article:: to self:: 2010-07-25 20:52:30 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Aryeh Gregor
3783aa2a3c Add non-identity collation, with migration script
It seemed to work correctly, with the newly-created page "bob" sorting
as "BOB", but then I nuked all my cl_sortkey by running the migration
script before refreshLinks.php had finished running, so I'll have to
wait a while to see if it works properly with a non-messed-up database.
It's possible there's something wrong with the display of section
letters in the categories, but otherwise I think this is working right.
2010-07-23 20:58:11 +00:00
Aryeh Gregor
29b840be46 Saner code formatting, fix a couple of bugs 2010-07-23 20:12:45 +00:00
Aryeh Gregor
190af3f507 Use modern coding constructs and a better var name
foreach ( $res as $row ), Title::newFromRow(), $row instead of $x.
2010-07-23 20:01:53 +00:00
Aryeh Gregor
907695c56a Initial commit for category collation framework
Hidden behind $wgExperimentalCategorySort until it's reasonably
complete.  If that's false, no behavior should change (but I didn't test
carefully, so poke me if there's a bug).  See DefaultSettings.php for
documentation on setting it to true.  Currently you should not do this
except if you're working on the feature, since functionality is not
close to reasonable yet and will change rapidly.

Bug 1211 is already fixed with this commit for me.  However, many other
things still need to be done, so this is all very much a
proof-of-concept.
2010-07-23 19:52:02 +00:00
Siebrand Mazeland
f8b1c4cfb7 Random indentation and code formatting updates. No functional changes. 2010-02-14 22:07:30 +00:00
Philip Tzou
be0cb93759 Follow up on r46020 and r46489. Improve the $wgContLang->convert() calling procedure on CategoryPage. 2009-07-26 15:54:11 +00:00
Aryeh Gregor
f52af0ba90 Clean up CategoryPage::columnList()
Should have no functional changes, other than maybe whitespace in the HTML.
2009-07-01 19:52:27 +00:00
Aryeh Gregor
4017234047 Typo in comment 2009-07-01 19:52:06 +00:00
Siebrand Mazeland
74d4302939 Suppress display of duplicate getCategoryBottom() if there are no category members to display.
Cannot know if completely suppressing this is possible (and show 'category-empty'), because 'until' or 'from' can be set and previous/next *may* give results). Adding a FIXME for that.
2009-06-20 09:21:33 +00:00
Siebrand Mazeland
f4d6729570 Make paging links on category pages known. This allows more comfortable browsing, even if the category does not exist. 2009-06-20 09:03:35 +00:00
Niklas Laxström
04f74a6b69 * Remove code duplication 2009-06-20 08:59:36 +00:00
Siebrand Mazeland
12126854f4 (bug 19211) Fix regression from r50351 that caused looping in previous/next navigation 2009-06-15 17:57:13 +00:00
Siebrand Mazeland
9138653266 (bug 19126) Follow-up to r51559: replace a period with a comma to get expected results. 2009-06-08 12:46:03 +00:00
Siebrand Mazeland
88d789e939 * replace some use of deprecated makeKnownLinkObj() by link() in core
* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability
2009-06-06 22:42:48 +00:00
Tim Starling
323c74c734 Reverted r49855, r49656, r49401, r49399, r49397. The language converter cannot be used outside the parser at present without generating a large number of bugs, due to global lifetime state variables, inappropriate $wgParser references, etc. Some refactoring needs to be done before it can be used in this way. 2009-05-26 07:46:29 +00:00
Siebrand Mazeland
a00a3882fa Follow-up on r50351. Fix adding key/value pair. 2009-05-09 23:03:11 +00:00
Siebrand Mazeland
3e27728fbc Follow-up on r50351. Fix syntax errors in CategoryPage.php 2009-05-08 23:27:42 +00:00
Siebrand Mazeland
547858b7fe Use link() instead of deprecated makeLinkObj() where possible. 2009-05-08 23:24:31 +00:00
Philip Tzou
3503ba26cd Enabled LanguageConverter on extension:CategoryTree.
Convert title text displayed in Category with title mode.
2009-04-25 05:13:18 +00:00
Alexandre Emsenhuber
f25769622e * (bug 18449) Fixed items number per column on category pages when the total is divisible by 3 2009-04-16 16:31:29 +00:00
Ilmari Karonen
9326eb7f0c properly HTML-escape titles in categories, just in case something bad somehow sneaks past title validation 2009-03-27 17:40:23 +00:00
Tim Starling
cd7b2f50fe Live patch: use a query group for CategoryPage 2009-02-17 03:07:41 +00:00
Brion Vibber
1ccd82ba0c * (bug 17207) Fix regression breaking category page display on PHP 5.1
r46020 added a call to $wgContLang->convert() for category article listings, but mistakenly passed the title *object* instead of the text.
In PHP 5.2, this was silently converted to a string, but in older versions this would interpolate as something useless like "Object id #110".
2009-01-28 21:32:19 +00:00
Niklas Laxström
fb4357b18e * Fix visible regression and let the plural finally work properly
* Reported by saper at mediawiki-i18n
2009-01-28 19:58:41 +00:00
Alexandre Emsenhuber
f2e0654b53 * Removed false comment, we are in a Category page, not an Image page
* Use wfMsgExt( 'msg', array( 'escape' ), ... ) rather than htmlspecialchars( wfMsg( ... ) )
* Whitespaces tweaks
2009-01-24 17:42:12 +00:00
Philip Tzou
a46248b4d8 Enable LanguageConverter on Category Pages. 2009-01-22 14:31:01 +00:00