Page MenuHomePhabricator

Provide a safe and short permanent link to a page (e.g. by title, or stable page id)
Closed, ResolvedPublic

Description

Author: gangleri

Description:
note: This feature request might be a duplicate. I spend an half an hour searching an old request fromm an contributor in a Wikipedia using non Basic Latin UTF-8 characters.

Dear friends;

Last week I saw a link to a page from the Wikipedia in Hebrew on facebook. It was a public computer using Internet Explorer on a Windows in the State Library of Bavaria in Mubich. I was neither able to click on the link nor to copy the link from facebook and paste it to the url line in IE because to improper UTF-8 handling of involved programs and operating system.

As you know there are a lot of redirecting special pages as [[Special:MyPage]], [[Special:MyTalk]] and some spelling variants for many other special pages.

Today http://en.wikipedia.org/w/index.php?title=User_talk:Gangleri/tests/sandbox/squares&oldid=307411828 is a permanent link to [[user_talk:Gangleri/tests/sandbox/squares]] a shorter version is http://en.wikipedia.org/w/index.php?oldid=307411828 as implemented in [[wikt:yi:MediaWiki:Gadget-ShortLink]]
see also
http://en.wikipedia.org/w/index.php?title=Wikipedia:WikiProject_User_scripts/Requests&oldid=190868168#toolbox_item_or_tab_with_a_short_format_link_using_.C2.AB_oldid.3D.7B.7BREVISIONID.7D.7D_.C2.BB

One solution to lates versions could be the implementation of "newest" as in a constructed link
http://en.wikipedia.org/w/index.php?diff=307411828&newest
(I have no clue what this link generates today).

Because I experienced lots of problems posting links at facebook containing ampersands I would suggest to implement a save redirecting special page [[Special:Newest/190868168]].

Best regards Reinhardt [[user:Gangleri]]


See also:

Details

Reference
bz21572

Event Timeline

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

gangleri wrote:

(In reply to comment #0)

... implement a save redirecting special page ...

should read
... implement a *safe* redirecting special page ...


Thanks Platonides;

your link worked a few seconds ago; after a minor edit it generates a bad title.

http://en.wikipedia.org/w/index.php?oldid=306683475 is valid
but
http://en.wikipedia.org/w/index.php?curid=306683475 is *not*.

note: due to caching you may still see an outdated result. PLease reload your cache or try again tomorrow.

But http://en.wikipedia.org/w/index.php?curid=23897925 *is*
oldid is a revision number. curid is a page number. Don't mix both numbers.
curid will refer to the same page regardless of its name (should follow even accross renames)
oldid refers to the a page content (ie. a revision).

gangleri wrote:

(In reply to comment #3)

But http://en.wikipedia.org/w/index.php?curid=23897925 *is*
oldid is a revision number. curid is a page number. Don't mix both numbers.

Thanks I understand. But I have no clue where to look for a page number. It might be that newbies can not handle this.

The feature request is mainly about simplest (safe) links as:

http://lccn.loc.gov/87119832
http://opc4.kb.nl/DB=1/PPN?PPN=173853307
http://d-nb.info/991503929
http://d-nb.info/740050788
etc.

It lists wgArticleId=23897925 at the page source on the header.
It is a little known feature, the articles are not expected to be reached by id, the only official way to reach an article is the page title, curid links are only a workaround, and are not guaranteed to be properly cached (Bug 20818)

gangleri wrote:

Thanks Platonides for the detailed comments.

I looked at
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/SpecialPage.php?view=markup
and could see

var $mAllowedRedirectParams = array();
/**
 * List of special pages, followed by parameters.
 * If the only parameter is a string, that is the page name.
 * Otherwise, it is an array. The format is one of:
 ** array( 'SpecialPage', name, right )
 ** array( 'IncludableSpecialPage', name, right, listed? )
 ** array( 'UnlistedSpecialPage', name, right )
 ** array( 'SpecialRedirectToSpecial', name, page to redirect to, special page param, ... )
 */

...
class SpecialMypage extends UnlistedSpecialPage { ...
...
class SpecialMytalk extends UnlistedSpecialPage { ...

Do you think it would take many lines of code to implement a similar functionality for [[Special:Newest/190868168]] ?

Because neither [[Special:MyPage]] nor [[Special:MyTalk]] require an explicit code page at http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/specials/ .

gangleri wrote:

additional note:
special:Mypage preserves anchors; see commons:special:Mypage#bugzilla_012225 redirecting for me correctly to [[commons:לערי_ריינהארט#bugzilla_012225]]
special:Newest (or whatever should be the name of the redirecting page) should do the same
see

  1. http://commons.wikimedia.org/w/index.php?oldid=32174572#media_examples oldid
  2. http://commons.wikimedia.org/w/index.php?curid=8329171#media_examples curid
  3. [[commons:special:Newest/190868168#media_examples]]

gangleri wrote:

(In reply to comment #7)

[[commons:לערי_ריינהארט#bugzilla_012225]]

should read [[commons:user:לערי_ריינהארט#bugzilla_012225]]

Do you think it would take many lines of code to implement a similar
functionality for [[Special:Newest/190868168]] ?

No. It would be easy to code. But i don't think it's the path to go.
If its only reason is for "safe links", curid already does that. Manually
creating links to Special:Newest wouldn't be easier than creating curid links.

gangleri wrote:

(In reply to comment #9)
...

No. It would be easy to code. But i don't think it's the path to go.
If its only reason is for "safe links", curid already does that. Manually
creating links to Special:Newest wouldn't be easier than creating curid links.

I made the request because of page moves. As you can see at
http://commons.wikimedia.org/w/index.php?title=Commons:Story_%28game%29_-_collaborative_work&action=history
curid might not preseve.

The feature request relates to have a safe link to the most actual content (regardless if the page was moved or not).

(In reply to comment #10)

(In reply to comment #9)
...

No. It would be easy to code. But i don't think it's the path to go.
If its only reason is for "safe links", curid already does that. Manually
creating links to Special:Newest wouldn't be easier than creating curid links.

I made the request because of page moves. As you can see at
http://commons.wikimedia.org/w/index.php?title=Commons:Story_%28game%29_-_collaborative_work&action=history
curid might not preseve.

The feature request relates to have a safe link to the most actual content
(regardless if the page was moved or not).

I don't understand. If you want a "safe link to the most actual content regardless of moves", why don't you just use the title, like http://en.wikipedia.org/wiki/Foo ? The point of curid links is to be able to link to a page even after a move, so that if [[Foo]] was moved to [[Bar]] later, a URL like http://en.wikipedia.org/w/index.php?curid=123 would point to the new name.

Could you be clearer as to which of these two behaviors you want, and why the existing features in the software aren't good enough?

gangleri wrote:

(In reply to comment #11)

Could you be clearer as to which of these two behaviors you want, and why the
existing features in the software aren't good enough?

Thanks for the comment Roan! I should have read comment #3 more carefuly:
...

curid will refer to the same page regardless of its name (should follow even
accross renames)
oldid refers to the a page content (ie. a revision).

I understand now that curid provides the right functionality. We should also agree that fetching the curid is tricky:
a) one needs to look at the source code of the page
b) there is no magic word "CURID" available at [[special:Version]] today

I think / dream about a feature (mainly) available at wikis using non Latin scripts where an additional item can be used in the toolbox the same way as
permalink' => 'Permanent link'
from http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/messages/MessagesEn.php?view=markup is used in the toolbox.

I assume that today there is no way to construct an equivalent to [[special:Curid/{{CURID}}]] (a better notation then [[Special:Newest/190868168]]) and offer the links automaticaly to all users / vizitors.

gangleri wrote:

P.S. [[Permanent_link]] lists / suggests / lets us think about
links without the characters %, ?, = and dimilar characters.

(In reply to comment #12)

I think / dream about a feature (mainly) available at wikis using non Latin
scripts where an additional item can be used in the toolbox the same way as
permalink' => 'Permanent link'
from
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/messages/MessagesEn.php?view=markup
is used in the toolbox.

That can be done immediatly using javascript.
Also quite easy to add as code. How would you call that link?

gangleri wrote:

(In reply to comment #14)
....

That can be done immediatly using javascript.
Also quite easy to add as code. How would you call that link?

Let's say "Short url". Please implement the code at http://test.wikipedia.org/ .
Thanks in advance!

gangleri wrote:

Please see http://test.wikipedia.org/w/index.php?title=special:ListUsers&limit=1&username=Platonides

I assume the feature request can be changed to another wording:

« safe referencing a page by its curid »

or whatsoever

Thanks. It has been implemented.
Bypass your cache and look at the bottom of the toolbox.

gangleri wrote:

Thanks a lot Platonides!

it works at the Yiddish wikis via MediaEiki:Common.js
http://yi.wiktionary.org/w/index.php?curid=3817
http://yi.wikipedia.org/w/index.php?curid=21880
http://yi.wikisource.org/w/index.php?curid=1825

and at my personal monobook.js pages:
http://commons.wikimedia.org/w/index.php?curid=120655
http://en.wikipedia.org/w/index.php?curid=1785858

I remember this feature was requested some years ago in relation to wikis using cyrillic script. Please post the solution at an appropriate place. Thanks in advance!

gangleri wrote:

FYI: The coded added at http://www.wikieducator.org/index.php?curid=75842 my monobook.js page adds the "short link" to "My Collection" not to "Toolbox". If you log in you may see this also at my page http://www.wikieducator.org/index.php?curid=75775 .

I remember this feature was requested some years ago in relation to wikis using
cyrillic script. Please post the solution at an appropriate place. Thanks in
advance!

You probably know better than me the places where it is needed, I am not on wikis outside iso-8859-1 :)

(In reply to comment #19)

FYI: The coded added at http://www.wikieducator.org/index.php?curid=75842 my
monobook.js page adds the "short link" to "My Collection" not to "Toolbox". If
you log in you may see this also at my page
http://www.wikieducator.org/index.php?curid=75775 .

On that wiki, the toolbox has two "sections": "My Collection" and "Toolbox".
The p-collection div shouldn't be a child of the p-tb one. Isn't there a newer version
of Collection extension?

a) "Short url" is not available for anonymous users at Yiddish wikis despite
the fact that the code is available in MediaEiki:Common.js (see comment #18).

It works. Force your cache to reload. (You probably also want to rename it)

b) "Short url" does not preserve parameters;

Where it makes no sense, it is designed so the link won't appear, that includes
special pages, articles yet to be written...
Special pages are magic, they aren't pages, so they don't have an article id.
If you want to safely link to special pages, you should use its canonical name
(the English one).

Wikis using special namespaces are probably better using customized version.
Try http://www.omegawiki.org/User:Platonides/monobook.js
(I hadn't logged there for three years, since the time it was WiktionaryZ...)

gangleri wrote:

(In reply to comment #21)
...

b) "Short url" does not preserve parameters;

...

Wikis using special namespaces are probably better using customized version.
Try http://www.omegawiki.org/User:Platonides/monobook.js
(I hadn't logged there for three years, since the time it was WiktionaryZ...)

http://www.omegawiki.org/User:Platonides/monobook.js is great! Thanks a lot!

gangleri wrote:

I reopen this request. The workaround with the Javascript was usefull a long time but due to some unknown reasons (maybe changes in MediaWiki and site setups) the Javascript is not working any more.

http://it.wikipedia.org/w/index.php?curid=3044130 describes a report at Italian Wikipedia.

Please reconsider to implement short referencing links as a standard functionality. I found many Wikipedia links in the past which redirects. A short referencing link would relate to the actual content of a topic and not to a title or to a certain revision only.

http://ro.wikipedia.org/w/index.php?title=Wikipedia:Cafenea&oldid=4336323#Probleme_legate_de_caracterele_specifice_limbii_rom.C3.A2ne is about an issue with homeoglyphs at Romanian Wikipedia. I do not know how many pages would need to be redirected there.

Best regards Reinhardt

P.S. You may investigate which are the reasons why the original Javascript is not functional today at Italian Wikipedia. Thanks in advance!

(In reply to comment #4)

(In reply to comment #3)

But http://en.wikipedia.org/w/index.php?curid=23897925 *is*
oldid is a revision number. curid is a page number. Don't mix both numbers.

Thanks I understand. But I have no clue where to look for a page number. It
might be that newbies can not handle this.

I've replaced the summary with what's your actual aim and I think that bug 38561 would fix it.

(In reply to comment #9)

Do you think it would take many lines of code to implement a similar
functionality for [[Special:Newest/190868168]] ?

No. It would be easy to code. But i don't think it's the path to go.
If its only reason is for "safe links", curid already does that. Manually
creating links to Special:Newest wouldn't be easier than creating curid links.

Platonides, how safe is curid?

(Krinkle on bug 42085 comment 14)

(In reply to comment #13)

Some short urls, which works:

https://en.wikipedia.org?curid=15580374
https://en.wikipedia.org?diff=521573414

These have been discussed in the past and should never be used as a short url.
Diff is a difference view, hardly useful. I assume that should be "oldid"
instead:
https://en.wikipedia.org?oldid=521573414

Which is a permanent link to a certain revision, however revisions can be
removed, hidden or merged. And one probably wants to link to the latest version
of an article.
'"curid" isn't very useful either because that links to the pageid, and
articles can be renamed, deleted, re-created, merged, and split. What we want
is link to a title, this is what the shorturl extension does. It creates a
short unique ID for titles.

...which is wrong at least for renames because Roan said:

(In comment #11)

The point of curid links is to be able to
link to a page even after a move, so that if [[Foo]] was moved to [[Bar]]
later, a URL like http://en.wikipedia.org/w/index.php?curid=123 would point to
the new name.

(In reply to comment #25)

(In reply to comment #9)

Do you think it would take many lines of code to implement a similar
functionality for [[Special:Newest/190868168]] ?

No. It would be easy to code. But i don't think it's the path to go.
If its only reason is for "safe links", curid already does that. Manually
creating links to Special:Newest wouldn't be easier than creating curid links.

Platonides, how safe is curid?

curid used to be a little unstable with pages that are deleted and then undeleted again, however it is pretty safe right now. However there is a fundamental difference between a permanent link to a page (for users) and a permanent link to an article on a certain subject (readers).

(Krinkle on bug 42085 comment 14)

(In reply to comment #13)

Some short urls, which works:

https://en.wikipedia.org?curid=15580374
https://en.wikipedia.org?diff=521573414

These have been discussed in the past and should never be used as a short url.
Diff is a difference view, hardly useful. I assume that should be "oldid"
instead:
https://en.wikipedia.org?oldid=521573414

Which is a permanent link to a certain revision, however revisions can be
removed, hidden or merged. And one probably wants to link to the latest version
of an article.
'"curid" isn't very useful either because that links to the pageid, and
articles can be renamed, deleted, re-created, merged, and split. What we want
is link to a title, this is what the shorturl extension does. It creates a
short unique ID for titles.

...which is wrong at least for renames because Roan said:

(In comment #11)

The point of curid links is to be able to
link to a page even after a move, so that if [[Foo]] was moved to [[Bar]]
later, a URL like http://en.wikipedia.org/w/index.php?curid=123 would point to
the new name.

As said, the shorturl discussed on bug 42085 is of different nature, I've therefore undid that erroneous dependency. In an editing context, you want a permanent link to the page, with its history and revisions (e.g. for patrolling an edit, or linking to a history page and what not).

However if you want a permanent link for sharing to the article about Foo, then we use title ids[1] (not page ids), which is what the ShortUrl extension implements. See bug 42085 for more info on that.

[1] For the exact reason Roan says. Because when you link to Foo, then you don't want to be linking to "Foo (disambiguation)" when it has been renamed, or if it was nominated for deletion and re-created 2 years later, you're linking to the title (not page) which is independent from time and space.

(In reply to comment #26)

However if you want a permanent link for sharing to the article about Foo, then
we use title ids[1] (not page ids), which is what the ShortUrl extension
implements. See bug 42085 for more info on that.

I've already read it and I disagree with what you say. This feature serves readers, which don't care e.g. if the article is moved to another title to respect lowercase/uppercase conventions, or to free it in order to create a disambiguation page, etc. If they want a permanent link, they just want to link the content they're seeing, which by definition will have to follow the history i.e. the page id.

Permanent links to a title (which to be really permanent would need ?redirect=no) are surely another use case, which is useful mainly for editors – who care about exact titles, histories and archives to be dug, linking titles which currently have no content or a different content but in a far future will have what the title should have according to conventions, ... and such things –, but has some overlap with the previous point.

Bug 42085 has currently three possible implementations: this bug, ShortUrl and LilURL-like; they should all be added as blockers until one is chosen, but the others don't have bugs AFAIK.

This bug has got quite confusing. Let me see if I can untangle it:

  • People want a safe permanent URL that
    • Points to a specific wiki page (by page ID/curid), not a revision (oldid) à la Special:PermanentLink nor a page title à la [[mw:Extension:ShortUrl]]
    • Contains no non-ASCII characters.
    • Is relatively short.
    • Is discoverable for those who need it (having it displayed on action=info might be enough).

In my view, index.php?curid=<page ID> has always worked for this, although it is not particularly short, some may dislike the query string syntax, and discoverability is poor (especially because the parameter is so badly named - bug 27087).

And now, per bug 58727, we can use Special:Redirect/page/<page ID>, which is nothing more than an alias for curid. It fits the bill a little better, although I guess if you want a really short URL, you could set up a rewrite on your server.

Please tell me if I got it wrong.

Nemo and gangleri, if you could clarify what you will want to see before this bug can be marked FIXED, it would be very helpful, so we can focus the progress here :)

TTO, the part about discoverability of curid (and now Special:Redirect I guess) is bug 42238, which probably is mainly a usability/design issue. I agree that curid is mostly enough, but people obviously didn't think so till now or we wouldn't have extensions doing that job.

Thanks Nemo, but my question remains:

(In reply to comment #28)

if you could clarify what you will want to see before this
bug can be marked FIXED, it would be very helpful, so we can focus the
progress here :)

This bug is quite vague, covering many mixed issues, and I feel that it needs a clear goal.

(In reply to comment #30)

Thanks Nemo, but my question remains

Let me rephrase then: this bug will be fixed to the reporter's satisfaction when people will think the solution enough to supersede the shorturl extension.

Aklapper lowered the priority of this task from Medium to Low.Jul 29 2017, 3:57 PM
Krinkle renamed this task from [Short URLs] Safe permanent link to a page (e.g. using one of its history id) to Provide a safe and short permanent link to a page (e.g. by title, or stable page id).Jan 26 2019, 7:02 AM
Krinkle removed a subscriber: wikibugs-l-list.

Closing as redundant in light of T60727, which now offers Special:Redirect/page/123456. That seems good enough.

Long-term, see also:

  • T201967 for a proposal to more generally shorten the urls for special pages.
  • T44085 for an arbitrary url shortener.