Last modified: 2011-03-13 18:06:17 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 T11548, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9548 - [Feature-Request] Make imagelists $sortable global
[Feature-Request] Make imagelists $sortable global
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.9.x
All All
: Lowest minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Special:...
: easy
Depends on:
Blocks:
  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: ---


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

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'] );


Thanks,
 Bene
Comment 1 BenediktM 2007-04-10 12:43:02 UTC
Created attachment 3432 [details]
patch
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.


Navigation
Links