Page MenuHomePhabricator

Internal links like [[File:Foo|caption]] should read 'caption', not 'File:Foo' when Foo is not an image
Closed, ResolvedPublic

Description

Author: biesbrock.kevin

Description:
The internal wiki link to a file using the optional second parameter does not yield expected results.

I do not currently see a bug listed in the bugzilla reports, assuming I was searching properly: tried, for example, "File", "File:", "Links", "Internal Links", "File Links", "Internal File", etc. I read through a lot of bugs but nothing seemed to immediately address this particular issue.

Start with facts I know:
*General internal link usage:
[[MyWikiPage]] => MyWikiPage
[[MyWikiPage|My Page]] => My Page
[[Media:MyMediaFile.png]] => Media:MyMediaFile.png
[[Media:MyMediaFile.png|My File]] => My File

Anything from that list would produce an anchor and display what's shown after the comment.

My concern is with the internal File: link. Now, I understand the File link is a loaded feature; with the additional ability to size an image for display, position, etc. I feel WM bugs out when the link does not link to a displayable file (i.e., an image). As an example:
*Internal File: links:
[[File:MyWikiFile.pdf]] => File:MyWikiFile.pdf
[[File:MyWikiFile.pdf|My File]] => File:MyWikiFile.pdf

In the second example, I feel (to remain consistent with other internal links) the anchor display text should be "My File" instead of "File:MyWikiFile.pdf".

I have to assume that since this is a rendering issue that it's all server side processing, so I don't think that operating system and browser matter. But just in case, XP Pro IE7.


Version: 1.14.x
Severity: major

Details

Reference
bz18784

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:38 PM
bzimport set Reference to bz18784.
bzimport added a subscriber: Unknown Object (MLST).

biesbrock.kevin wrote:

It's not specific to red links.

But I like your title a lot better, thank you :)

  • Bug 22344 has been marked as a duplicate of this bug. ***

conrad.irwin wrote:

Fixed in r61816

ayg wrote:

Why should <nowiki>[[File:Foo|Bar]]</nowiki> with a broken link be consistent with <nowiki>[[Foo|Bar]]</nowiki>, rather than with <nowiki>[[File:Foo|Bar]]</nowiki> with a working link? I'd expect the latter.

biesbrock.kevin wrote:

I don't understand your question.(In reply to comment #4)

Why should <nowiki>[[File:Foo|Bar]]</nowiki> with a broken link be consistent
with <nowiki>[[Foo|Bar]]</nowiki>, rather than with
<nowiki>[[File:Foo|Bar]]</nowiki> with a working link? I'd expect the latter.

conrad.irwin wrote:

(In reply to comment #4)

Why should <nowiki>[[File:Foo|Bar]]</nowiki> with a broken link be consistent
with <nowiki>[[Foo|Bar]]</nowiki>, rather than with
<nowiki>[[File:Foo|Bar]]</nowiki> with a working link? I'd expect the latter.

It seems better to be consistent with [[Foo|bar]] than not consistent at all. Feel free to create a "broken image" placeholder (I imagine that an image would still be fine in place of audio/video/whatever) which would indicate "broken, click here to fix" just as the current red-link does. (This would have the main advantage of making the brokenness of [[File:bloop|thumb|caption]] similar to that of [[File:bloop|right|caption]])

biesbrock.kevin wrote:

I guess that's why I don't understand your comment. The default behavior of a [[Foo|bar]] link is to display a red "bar" which brings you to a "Foo" link. That's why this issue was raised. To be consistent a link of [[File:Foo|Bar]] should show "Bar" with a link to "Foo".

ayg wrote:

I was confused, I thought this had to do with images that didn't exist rather than files that couldn't be embedded. Never mind me.

biesbrock.kevin wrote:

It does have to do with files that don't exist. I guess with images that don't exist, displaying an image placeholder is a good alternative. But file names can get pretty long, so I see having that "alt name" in there with a red link would be beneficial.
(In reply to comment #8)

I was confused, I thought this had to do with images that didn't exist rather
than files that couldn't be embedded. Never mind me.

ayg wrote:

For files that don't exist, shouldn't we match the convention for templates that don't exist? {{nonexistent}} becomes a redlink [[Template:Nonexistent]].