Last modified: 2012-06-18 02:32:55 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 T39452, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37452 - class="mw-redirect" for Special:PrefixIndex
class="mw-redirect" for Special:PrefixIndex
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.20.x
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Patricio Molina
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-10 14:16 UTC by Fomafix
Modified: 2012-06-18 02:32 UTC (History)
4 users (show)

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


Attachments

Description Fomafix 2012-06-10 14:16:49 UTC
[[Special:PrefixIndex]] should also contain class="mw-redirect" for redirects like [[Special:AllPages]].

Example:

https://www.mediawiki.org/w/index.php?title=Special:PrefixIndex&prefix=A
contains
 <a title="AFT" href="/wiki/AFT">AFT</a>

https://www.mediawiki.org/w/index.php?title=Special:AllPages&from=A
contains
 <a title="AFT" class="mw-redirect" href="/wiki/AFT">AFT</a>
Comment 1 Patricio Molina 2012-06-10 15:26:06 UTC
includes/specials/SpecialPrefixindex.php uses Linker::linkKnown() (which has
"noclasses" in their structure) instead of Linker::link()

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/specials/SpecialPrefixindex.php;h=730969df03bd2f282bc091421e45aa2ff6dee306;hb=master#l197

Does anybody know why linkKnown() is used instead of link()?
Comment 2 Platonides 2012-06-10 15:30:59 UTC
That avoids an extra db query to check if the file exists or not.

You can add that class to the $customAttribs depending on $s->page_is_redirect
Comment 3 Dereckson 2012-06-10 22:28:48 UTC
Assigned to patch submitter.
Comment 4 Platonides 2012-06-10 23:00:05 UTC
Patch submitter? Where's the patch?
Do you mean you're working on it and going to provide a patch?
Comment 5 Patricio Molina 2012-06-11 00:31:21 UTC
Changes made in https://gerrit.wikimedia.org/r/#/c/10854/
Comment 6 Patricio Molina 2012-06-11 00:45:37 UTC
I received this notification: https://integration.mediawiki.org/ci/job/MediaWiki-Tests-Parser/2051/

ParserTests::testParserTest with data set #470 ('Special page transclusion', '{{Special:Prefixindex/Xyzzyx}}', '<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
', '', '')
Special page transclusion
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+'<table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx" class="mw-redirect">Xyzzyx</a></td></tr></table>

I think we should change the expected string in order to satisfy this unit test.
Comment 7 Dereckson 2012-06-11 08:55:25 UTC
(In reply to comment #4)
> Patch submitter? Where's the patch?
> Do you mean you're working on it and going to provide a patch?

I meant Patricio Molina were working on this issue and submitted code through gerrit.
Comment 8 Platonides 2012-06-12 22:45:05 UTC
Sorry, I saw
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |dereckson@<email>

and thought you were assigning it to yourself.
(patricio had already placed himself as assignee before)
Comment 9 Platonides 2012-06-12 22:46:35 UTC
> I think we should change the expected string in order to satisfy this unit
> test.

Yes. Change it in tests/parser/parserTests.txt, and resubmit the amended changeset including that file.
Comment 10 Platonides 2012-06-12 22:47:49 UTC
Also note, your patch is wrong in that it is adding mw-redirect to all links, not only to those that are redirects.
Comment 11 Patricio Molina 2012-06-13 03:17:11 UTC
(In reply to comment #10)
> Also note, your patch is wrong in that it is adding mw-redirect to all links,
> not only to those that are redirects.

Thanks! I didn't notice that. I've added a condition to apply that class only to redirects.

It wasn't necessary to change the test case.
Comment 12 Robin Pepermans (SPQRobin) 2012-06-18 02:32:55 UTC
Marking FIXED since https://gerrit.wikimedia.org/r/#/c/10854/ is merged by Siebrand.

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


Navigation
Links