Last modified: 2011-06-23 00:38:48 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 T19141, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17141 - IPv4 addresses do not sort within sortable tables.
IPv4 addresses do not sort within sortable tables.
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.16.x
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: need-unittest, patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-24 01:03 UTC by dpotter
Modified: 2011-06-23 00:38 UTC (History)
4 users (show)

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


Attachments
Wikibits patch that adds the ability for sortable wikitables to sort IPv4 addresses (1.82 KB, patch)
2009-01-24 01:06 UTC, dpotter
Details
updated patch that handles whitespace to left or right of IP address (1.82 KB, patch)
2009-01-24 01:41 UTC, dpotter
Details
updated for compatibility with development version (1.98 KB, patch)
2010-01-20 21:24 UTC, dpotter
Details

Description dpotter 2009-01-24 01:03:21 UTC
It would be nice if MediaWiki could correctly sort IPv4 addresses (e.g. 10.1.203.40) in sortable tables. 

Currently, wikibits.js identifies them as numerics and refuses to sort them correctly. Prepending a "&" to force a text search doesn't help unless the IP addresses are uglified to include leading zeros (e.g. 010.001.203.040).

I've attached a patch that adds the ability to automatically identify and sort IPv4 addresses.  It's my first MediaWiki contribution, so please review it carefully.
Comment 1 dpotter 2009-01-24 01:06:09 UTC
Created attachment 5724 [details]
Wikibits patch that adds the ability for sortable wikitables to sort IPv4 addresses
Comment 2 dpotter 2009-01-24 01:41:19 UTC
Created attachment 5725 [details]
updated patch that handles whitespace to left or right of IP address
Comment 3 Ben Simmons 2010-01-20 04:39:56 UTC
(In reply to comment #2)
> Created an attachment (id=5725) [details]
> updated patch that handles whitespace to left or right of IP address

A fix for this problem would be very helpful - we use lots of IP addresses in sortable tables with MW and they have the exact problems described here.  Unfortunately I am not a programmer so I can't review the code.
Comment 4 dpotter 2010-01-20 17:18:53 UTC
FWIW, this patch has been in operations at our facility for about a year now with no problems.
Comment 5 Sam Reed (reedy) 2010-01-20 17:21:06 UTC
Does the patch still apply cleanly? (For the lazy ones of us here ;))
Comment 6 dpotter 2010-01-20 18:24:53 UTC
(In reply to comment #5)
> Does the patch still apply cleanly? (For the lazy ones of us here ;))

Oh God no. Hasn't applied cleanly since 1.12.  That'll teach me to upload patches here instead of just committing them to trunk.
Comment 7 Sam Reed (reedy) 2010-01-20 18:36:59 UTC
Removing patch and needs-review

Gonna need manually remaking...
Comment 8 dpotter 2010-01-20 21:24:18 UTC
Created attachment 6989 [details]
updated for compatibility with development version
Comment 9 dpotter 2010-01-20 21:31:17 UTC
applies cleanly to 1.16-svn
Comment 10 Chad H. 2010-01-20 21:36:40 UTC
Do not mark bugs fixed until the patch has been applied.
Comment 11 Sam Reed (reedy) 2010-01-20 22:02:45 UTC
Very True

I'll see if i can apply and test it in a little bit for you :)
Comment 12 Aaron Schulz 2011-02-13 23:49:45 UTC
Why does ts_parseIP() have an "octetlist" var (and not "quadlist"). Also, it probably could use a for loop to reduce the duplication.
Comment 13 dpotter 2011-02-14 16:53:12 UTC
(In reply to comment #12)
> Why does ts_parseIP() have an "octetlist" var (and not "quadlist").

ts_parseIP() has an "octetlist" because it contains a list of octets.  

Why are they "octets" and not "quads"?  Because the specification for the Internet Protocol calls these items "octets".  See RFC 791 (Postel, 1981).  

Why does the RFC refer to them as "octets" instad of "bytes"?  Because the term "octet" denotes to 8 bits, whereas "byte" refers to an undefined group of bits (usually 8 bits, but 6,7,or 10 on some computer architectures.)  This is an important distinction for a networking protocol whose goal is to enable communications between systems regardless of processing architecture.
Comment 14 Aaron Schulz 2011-02-14 19:01:02 UTC
"octet" makes sense on the bit level, though this patch doesn't operate on that level. It's just exploding the dotted-quad notation and padding the integers. The use of "octet" just seemed a bit odd. Probably just personal preference :)
Comment 15 DieBuche 2011-04-15 08:37:13 UTC
Fixed  in r86088
Comment 16 Brion Vibber 2011-06-22 20:02:37 UTC
r86088 is seriously broken and may get reverted; reopening. Needs unit tests (see initial basic unit tests in r90595 which show up errors; will also need tests for the particular case this bug is about.)
Comment 17 Brion Vibber 2011-06-23 00:38:48 UTC
Test cases and a fix for single-digit octets added in r90637. Needs merge to 1.18 branch, marked in CR.

Re-resolving fixed.

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


Navigation
Links