User:Dbenbenn/MediaWiki wishlist

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Here are my thoughts about some bugs in MediaWiki, and how to fix them.

Image redirects

[edit]

If Image:A has no actual file, and the description page consists of a redirect to Image:B, then [[Image:A]] should display image B.

[edit]

One way to implement this feature is with symbolic links.

Presumably you'd want commons/X/XY/A to be a symbolic link to commons/x/xy/B. Thumbnails present a difficulty, because the naming scheme is commons/thumb/X/XY/A/123px-A, so you can't simply have commons/thumb/X/XY/A/ be a symbolic link to commons/thumb/x/xy/B/. Instead you have to make symbolic links for each individual thumbnail. Possibly the naming scheme could be fixed.

I don't know whether browser caching would have difficulties. Suppose Image:B was uploaded on August 20, and Image:C on August 19, and Image:A is changed from redirecting to B to C. A browser that caches Image:A before the change won't download the new Image:A after the redirect change. Can that be fixed?

[edit]

We can avoid the caching problem by avoiding symbolic links. If Foo uses Image:A which redirects to Image:B, when the HTML is generated for Foo we could simply use commons/x/xy/B as the image instead of A.

MediaWiki has to be smart enough to regenerate the page if the image redirect changes. Consider the case where Image:A consists of

#redirect [[:Image:{{Potd/{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}}}]]

Presumably MediaWiki has this capability with respect to templates already. Can it be extended to images?

Category redirects

[edit]

If Category:A consists of

#redirect [[Category:B]]

and Foo is in Category:A, it should show up in the listing of Category:B. That would make it trivial to merge or move categories.

It is possible to implement this feature efficiently. It might, however, be impractical due to the database schema MediaWiki is limited to.

[edit]

The "Links" section at an image description page should always be accurate. Currently, if Image:A is used in Template:Foo which is used in Bar, and then Image:A is removed from Template:Foo, Bar remains in the list of pages using Image:A.

The naive solution to this bug is inefficient. It can be solved efficiently, however, in more or less the same way as the category redirects bug above.

Meta templates

[edit]

Currently meta templates (templates that use other templates) are deprecated for efficiency reasons. If Foo uses Template:Bar which uses Template:Meta-bar, and Foo is changed, MediaWiki has to look up Template:Bar and Template:Meta-bar in the database in order to render Foo. This is just plain silly. Template:Bar should be cached, so that re-rendering Foo only requires looking up the cached version of Template:Bar.

[edit]

MediaWiki shouldn't use "class='external text'" on any internal links, such as Media:Petersen graph.svg or edit this section.