Last modified: 2014-11-17 10:36:48 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 8339 - Provide class name for links to disambiguation pages
Provide class name for links to disambiguation pages
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Disambiguator (Other open bugs)
unspecified
All All
: Low enhancement with 6 votes (vote)
: ---
Assigned To: Bartosz Dziewoński
:
: 11902 (view as bug list)
Depends on: 53945
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-20 17:52 UTC by Duncan Harris
Modified: 2014-11-17 10:36 UTC (History)
12 users (show)

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


Attachments

Description Duncan Harris 2006-12-20 17:52:21 UTC
I'm not sure this can be done without fixing
http://bugzilla.wikipedia.org/show_bug.cgi?id=6754 first, but...

Links to disambiguation pages are (mostly) bad.  The only way to find out
whether a page one is linking to is a disambiguation page is by going there, and
perhaps remembering for the future, unless it's obvious like [[tree
(disambiguation)]] or something.

The obvious colour is green, though how this will sit with those who have
[[colour blindness]], I don't know (though they seem to manage ok with [[traffic
lights]])
Comment 1 Rob Church 2006-12-20 17:56:02 UTC
We said no to this for links to redirects, didn't we?
Comment 2 Rotem Liss 2006-12-20 17:59:55 UTC
Links to disambiguation pages shouldn't be exist: use
[[Special:Disambiguations]] to clean them up.
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-12-20 18:57:25 UTC
(In reply to comment #1)
> We said no to this for links to redirects, didn't we?

Because redirect links are supposed to be functionally identical to any links to
the target page.  Not really applicable.  We already have (optionally) a
different color for pages below a specified length.
Comment 4 Speed8ump 2007-07-03 16:11:58 UTC
Most links to disambiguation pages are created unintentionally.  If, when editing a page, links to disambiguation pages were a different color (probably the same as/similar to non-existant pages) editors would immediately be able to tell they needed to alter their link during previews.

A side effect of implementing this behavior: there should be a method for explicitly linking to the disambiguation page, without the different color, in the rare circumstance where that is the author's intent.
Comment 5 Roan Kattouw 2007-07-03 18:50:22 UTC
This is gonna be expensive to implement. Rather than just checking whether a page exists, we'd need to check whether it transcludes Template:Disambig, which is significantly more trouble when checking hundreds of pages at a time.
Comment 6 Rob Church 2007-07-03 18:53:36 UTC
(In reply to comment #5)
> This is gonna be expensive to implement.

This is distinctly why bug 6754 is marked as a dependency.
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-11-09 18:30:46 UTC
(In reply to comment #5)
> This is gonna be expensive to implement. Rather than just checking whether a
> page exists, we'd need to check whether it transcludes Template:Disambig, which
> is significantly more trouble when checking hundreds of pages at a time.

Is it?  I tried a slightly modified version of the query from Special:Allpages, as a simple case.  Compare:

mysql> EXPLAIN SELECT page_namespace,page_title,page_is_redirect  FROM `page` FORCE INDEX (name_title) WHERE page_namespace = '0' AND (page_title >= 'Closed')  ORDER BY page_title LIMIT 10;
+----+-------------+-------+------+---------------+------------+---------+-------+--------+-------------+
| id | select_type | table | type | possible_keys | key        | key_len | ref   | rows   | Extra       |
+----+-------------+-------+------+---------------+------------+---------+-------+--------+-------------+
|  1 | SIMPLE      | page  | ref  | name_title    | name_title | 4       | const | 585538 | Using where | 
+----+-------------+-------+------+---------------+------------+---------+-------+--------+-------------+
1 row in set (0.01 sec)

mysql> SELECT page_namespace,page_title,page_is_redirect  FROM `page` FORCE INDEX (name_title) WHERE page_namespace = '0' AND (page_title >= 'Closed')  ORDER BY page_title LIMIT 10;
+----------------+---------------------------+------------------+
| page_namespace | page_title                | page_is_redirect |
+----------------+---------------------------+------------------+
|              0 | Closed                    |                0 | 
|              0 | Closed-Circuit_Television |                1 | 
|              0 | Closed-Cone_Pine_Forest   |                1 | 
|              0 | Closed-End_Fund           |                1 | 
|              0 | Closed-_loop              |                1 | 
|              0 | Closed-angle_glaucoma     |                1 | 
|              0 | Closed-apple_key          |                1 | 
|              0 | Closed-bolt               |                1 | 
|              0 | Closed-caption            |                1 | 
|              0 | Closed-caption_television |                1 | 
+----------------+---------------------------+------------------+
10 rows in set (5.09 sec)

Versus the query with disambig:

mysql> EXPLAIN SELECT page_namespace,page_title,page_is_redirect,COUNT(tl_from) != 0 AS disambig FROM `page` FORCE INDEX (name_title) LEFT JOIN templatelinks FORCE INDEX (tl_from) ON page_id=tl_from AND tl_namespace=10 AND tl_title IN ('Bio-dab', 'Dab', 'Diasmbig', 'Disamb', 'Disamb-cleanup', 'Disambig', 'Disambig-cleanup', 'Disambiguation', 'Geodis', 'Hndis', 'Hndisambig', 'Numberdis', 'Roaddis', 'Surname') WHERE page_namespace = '0' AND (page_title >= 'Closed') GROUP BY page_title ORDER BY page_title LIMIT 10;
+----+-------------+---------------+------+----------------------+------------+---------+---------------------------+--------+-------------+
| id | select_type | table         | type | possible_keys        | key        | key_len | ref                       | rows   | Extra       |
+----+-------------+---------------+------+----------------------+------------+---------+---------------------------+--------+-------------+
|  1 | SIMPLE      | page          | ref  | name_title           | name_title | 4       | const                     | 585543 | Using where | 
|  1 | SIMPLE      | templatelinks | ref  | tl_from,tl_namespace | tl_from    | 8       | enwiki.page.page_id,const |      3 | Using index | 
+----+-------------+---------------+------+----------------------+------------+---------+---------------------------+--------+-------------+
2 rows in set (0.02 sec)

mysql> SELECT page_namespace,page_title,page_is_redirect,COUNT(tl_from) != 0 AS disambig FROM `page` FORCE INDEX (name_title) LEFT JOIN templatelinks FORCE INDEX (tl_from) ON page_id=tl_from AND tl_namespace=10 AND tl_title IN ('Bio-dab', 'Dab', 'Diasmbig', 'Disamb', 'Disamb-cleanup', 'Disambig', 'Disambig-cleanup', 'Disambiguation', 'Geodis', 'Hndis', 'Hndisambig', 'Numberdis', 'Roaddis', 'Surname') WHERE page_namespace = '0' AND (page_title >= 'Closed') GROUP BY page_title ORDER BY page_title LIMIT 10;
+----------------+---------------------------+------------------+----------+
| page_namespace | page_title                | page_is_redirect | disambig |
+----------------+---------------------------+------------------+----------+
|              0 | Closed                    |                0 |        1 | 
|              0 | Closed-Circuit_Television |                1 |        0 | 
|              0 | Closed-Cone_Pine_Forest   |                1 |        0 | 
|              0 | Closed-End_Fund           |                1 |        0 | 
|              0 | Closed-_loop              |                1 |        0 | 
|              0 | Closed-angle_glaucoma     |                1 |        0 | 
|              0 | Closed-apple_key          |                1 |        0 | 
|              0 | Closed-bolt               |                1 |        0 | 
|              0 | Closed-caption            |                1 |        0 | 
|              0 | Closed-caption_television |                1 |        0 | 
+----------------+---------------------------+------------------+----------+
10 rows in set (5.10 sec)

Note: This is on the toolserver and so is crazy slow, the real query should be a few milliseconds in either case, but the point is there's no real difference.  Anyway, this is just an example, it could be easily adapted to LinkBatch or whatnot.
Comment 8 Brion Vibber 2007-12-05 20:26:35 UTC
*** Bug 11902 has been marked as a duplicate of this bug. ***
Comment 9 Raimond Spekking 2013-05-01 18:51:11 UTC
A CSS class can be added now with the Disambiguator extension hooking into 'LinkEnd'
Comment 10 Gerrit Notification Bot 2013-09-04 12:20:09 UTC
Change 82604 had a related patch set uploaded by Raimond Spekking:
Add a CSS class to disambiguation pages

https://gerrit.wikimedia.org/r/82604
Comment 11 Gerrit Notification Bot 2013-12-07 03:16:11 UTC
Change 100115 had a related patch set uploaded by Kaldari:
Conditionally add a CSS class to disambiguation pages

https://gerrit.wikimedia.org/r/100115
Comment 12 Gerrit Notification Bot 2013-12-07 14:21:46 UTC
Change 82604 abandoned by Raimond Spekking:
Add a CSS class to disambiguation pages

Reason:
In favour of Kaldari's change Id511fd84 for an alternative implementation. Thank you!

https://gerrit.wikimedia.org/r/82604
Comment 13 Gerrit Notification Bot 2013-12-09 18:46:29 UTC
Change 100115 abandoned by Kaldari:
Conditionally add a CSS class to disambiguation pages

Reason:
Per MaxSem

https://gerrit.wikimedia.org/r/100115
Comment 14 Gerrit Notification Bot 2014-09-02 17:03:50 UTC
Change 157836 had a related patch set uploaded by Bartosz Dziewoński:
Add 'mw-disambig' CSS class to disambiguation pages

https://gerrit.wikimedia.org/r/157836
Comment 15 Bartosz Dziewoński 2014-09-02 17:04:40 UTC
Once more, with feeling. This time the solution should be performant :)
Comment 16 Gerrit Notification Bot 2014-09-03 17:34:58 UTC
Change 157836 merged by jenkins-bot:
Add 'mw-disambig' CSS class to disambiguation pages

https://gerrit.wikimedia.org/r/157836
Comment 17 James Forrester 2014-09-03 17:37:16 UTC
Yay.

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


Navigation
Links