Last modified: 2011-03-13 18:06:17 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 9548 - [Feature-Request] Make imagelists $sortable global
[Feature-Request] Make imagelists $sortable global
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Lowest minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
  Show dependency treegraph
Reported: 2007-04-10 12:41 UTC by BenediktM
Modified: 2011-03-13 18:06 UTC (History)
0 users

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

patch (413 bytes, patch)
2007-04-10 12:43 UTC, BenediktM

Description BenediktM 2007-04-10 12:41:23 UTC
The table in Special:Imagelist is sortable by columns defined in
ImageListPager->isFieldSortable which checks via in_array against "static
$sortable". Please make this variable configurable per LocalSettings. E.g. by
applying this patch against includes/SpecialImagelist.php:

--- C:/Dokumente und Einstellungen/Benedikt/Desktop/oldImagelist.txt	Tue Apr 10
14:35:25 2007
+++ C:/Dokumente und Einstellungen/Benedikt/Desktop/newImagelist.txt	Tue Apr 10
14:35:20 2007
@@ -64,12 +64,12 @@
 		return $this->mFieldNames;
 	function isFieldSortable( $field ) {
-		static $sortable = array( 'img_timestamp', 'img_name', 'img_size' );
-		return in_array( $field, $sortable );
+		global $wgImagelistSortable;
+		return in_array( $field, $wgImagelistSortable );
 	function getQueryInfo() {
 		$fields = $this->getFieldNames();
 		unset( $fields['links'] );

Comment 1 BenediktM 2007-04-10 12:43:02 UTC
Created attachment 3432 [details]
Comment 2 Rob Church 2007-04-11 00:32:34 UTC
You'll need to provide default values for the setting so existing behaviour is
not affected, and document the new variable.
Comment 3 Rob Church 2007-04-11 02:51:50 UTC
Reviewing it, this function appears to be for the purposes of limiting sorting
to columns where there are appropriate indexes to support efficient sorting in
that manner, and where the supporting UI elements exist.

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