Page MenuHomePhabricator

[Regression] Previously valid fullurl with empty article name now broken
Closed, DeclinedPublic

Description

Author: mr.heat

Description:
This short syntax:

{{fullurl:de:|diff=117674067}}
{{fullurl::|diff=117674067}}

did work without a problem. It created this perfectly valid URL:

//de.wikipedia.org/w/index.php?title=&diff=117674067

Users and scripts are relying on this syntax. It was used on several pages. They are all broken now. This makes this a regression. Please make it work again. Thanks. From what I see there shouldn't be a strong reason to block the syntax if the page name is empty. The currently broken output (it tries to find a template with that name) is far worse.


Version: 1.23.0
Severity: normal

Details

Reference
bz58793

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:15 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz58793.
bzimport added a subscriber: Unknown Object (MLST).

This is probably caused by the fix for bug 54044 (I574168c9).

Umherirrender: can you take a look into this?

I'm really not sure if this is a valid use-case; fullurl: and other parser functions listed at https://www.mediawiki.org/wiki/Help:Magic_words#URL_data require their parameter to be a valid title, and ":" is not one.

You can achieve the same effect with {{SERVER}}{{SCRIPTPATH}}?diff=117674067, would replacing that cause a lot of trouble? (Is it hardcoded in pages, or just a couple of templates? If yes, we could probably special-case "" and ":" in that function, but I'd rather not do that :(

In my opinion fullurl:: was a hack, which now is broken, but that is always possible for hacks. A special case in fullurl: sounds not like a good idea.

A new hack could be #

{{fullurl:#|diff=117674067}}

But it sounds still like a hack

mr.heat wrote:

I would love to have a [[Special:Diff/117674067]] syntax instead. Similar to [[Special:Permalink/117674067]]. But currently there is no better way to link to a diff. The suggested {{SERVER}}{{SCRIPTPATH}}?diff=117674067 syntax is more complicated.

Argument #1: It doesn't really matter if you call it a "hack". It worked. It did what it was supposed to do. Now it does not work any more. The change broke existing pages.

Argument #2: A {{fullurl:...}} should always be treaded as a core function and never as a template, no matter what's written after the colon. Currently it tries to transclude a non existing [[Template:Fullurl:]], [[Template:Fullurl::]] or worse. This is confusing.

Argument #3: All these are valid URLs:
https://de.wikipedia.org/w/?title=de:Wikipedia:Hauptseite
https://de.wikipedia.org/w/?title=Wikipedia:Hauptseite
https://de.wikipedia.org/w/?title=:
https://de.wikipedia.org/w/?title=
https://de.wikipedia.org/w/?title=de:Wikipedia:Hauptseite&diff=117674067
https://de.wikipedia.org/w/?title=Wikipedia:Hauptseite&diff=117674067
https://de.wikipedia.org/w/?title=:&diff=117674067
https://de.wikipedia.org/w/?title=&diff=117674067

Therefor all these calls of the fullurl function should create the same valid URLs as shown above:
{{fullurl:de:Wikipedia:Hauptseite}}
{{fullurl:Wikipedia:Hauptseite}}
{{fullurl::}}
{{fullurl:}}
{{fullurl:de:Wikipedia:Hauptseite|diff=117674067}}
{{fullurl:Wikipedia:Hauptseite|diff=117674067}}
{{fullurl::|diff=117674067}}
{{fullurl:|diff=117674067}}

(In reply to comment #6)

I would love to have a [[Special:Diff/117674067]] syntax instead.
Similar to [[Special:Permalink/117674067]]. But currently there is
no better way to link to a diff.

A patch for this is pending: https://gerrit.wikimedia.org/r/#/c/63395/ .
It needs some work, though.

Argument #1: It doesn't really matter if you call it a "hack". It
worked. It did what it was supposed to do. Now it does not work any
more. The change broke existing pages.

No, that did not do what it was supposed to – in fact, it wasn't
supposed to work the way you used it.

I have already asked about the magnitude of the problems this caused in
comment 3 and have yet to receive an answer, but given that I haven't
heard any other reports that magnitude is rather small.

Argument #2: A {{fullurl:...}} should always be treaded as a core
function and never as a template, no matter what's written after the
colon. Currently it tries to transclude a non existing
[[Template:Fullurl:]], [[Template:Fullurl::]] or worse. This is
confusing.

This might be a valid complaint. The behavior, however, is consistent
with the behavior of other magic words when they are called incorrectly;
if we want it changed, I think it should be done in a separate bug.

Argument #3: All these are valid URLs:
https://de.wikipedia.org/w/?title=de:Wikipedia:Hauptseite
https://de.wikipedia.org/w/?title=Wikipedia:Hauptseite
https://de.wikipedia.org/w/?title=:
https://de.wikipedia.org/w/?title=
https://de.wikipedia.org/w/?title=de:Wikipedia:Hauptseite&diff=117674067
https://de.wikipedia.org/w/?title=Wikipedia:Hauptseite&diff=117674067
https://de.wikipedia.org/w/?title=:&diff=117674067
https://de.wikipedia.org/w/?title=&diff=117674067

That's not true, the third one now results in a "Bad title" error.
The seventh one only works because the 'title' parameter is ignored
when 'diff' is given.

Let me also note that in the fourth one the empty 'title' parameter
is filled with the 'Main Page' title (which is why visiting
"https://de.wikipedia.org/" works).

Therefor all these calls of the fullurl function should create the
same valid URLs as shown above: {{fullurl:de:Wikipedia:Hauptseite}}
{{fullurl:Wikipedia:Hauptseite}} {{fullurl::}} {{fullurl:}}
{{fullurl:de:Wikipedia:Hauptseite|diff=117674067}}
{{fullurl:Wikipedia:Hauptseite|diff=117674067}}
{{fullurl::|diff=117674067}} {{fullurl:|diff=117674067}}

{{fullurl: requires a valid title, and '' and ':' are not valid titles.
As I mentioned, we could add a hack to make that work, but I'd rather
not (without at least assessing the impact, see comment 3).

What would you expect {{fullurl:<>}} to do? {{fullurl::}} and
{{fullurl:}} behave in the same way.

I'm going to go ahead and agree that the intention of parser functions like this is that {{fullurl}} requires a valid Title object in order to operate properly. The proper method for custom URL construction would be just that: custom URL construction, probably using the method demonstrated in comment 3.

Because of this I'm going to close this bug. I am sorry that this broke your specific workflow, but unfortunately this was the result of using an undefined functionality that just so happened to work. Hopefully the Special:DiffLink patch provides a better alternative.

mr.heat wrote:

(In reply to comment #7)

that did not do what it was supposed to

It did. It was supposed to create valid links and that was exactly what it did. There was nothing wrong with the diff links it created. You broke an existing functionality. That's called a regression.

I have already asked about the magnitude of the problems this caused in
comment 3 and have yet to receive an answer, but given that I haven't
heard any other reports that magnitude is rather small.

I'm sorry? You refuse to see a problem here. I got this. This does not mean the problem does not exist. The syntax is used in pretty much every bigger MediaWiki installation on many pages, mainly talk pages. It's almost impossible to track and fix all the now broken posts. It's a regression.

https://de.wikipedia.org/w/?title=:

now results in a "Bad title" error.

How do you know this is not the same regression?

the 'title' parameter is ignored when 'diff' is given.

Thats the point. fullurl should do the same. Simple.

{{fullurl: requires a valid title, and '' and ':' are not valid titles.

Did I mentioned this is a regression? Using ":" was valid before. Now it's not. This is a regression.

What would you expect {{fullurl:<>}} to do?

This is not connected to this report. These characters were always invalid in titles. Colons aren't invalid in titles. Using "<>" never worked. Using ":" did.

(In reply to comment #8)

the intention of parser functions like
this is that {{fullurl}} requires a valid Title object in order to operate
properly. The proper method for custom URL construction would be just that:
custom URL construction

Fact: fullurl is for custom URL construction.

Fact: A diff link does not need a title. It's ignored anyway.

Therefor: fullurl with a diff parameter must do the same and ignore the title.

this broke your specific workflow

It broke existing pages.

":" is not a valid title, and that's not a regression, but a bugfix. Empty titles are not valid, and ":" normalises to an empty title.

I have yet to see a single page broken by this.

(In reply to comment #10)

":" is not a valid title, and that's not a regression, but a bugfix. Empty
titles are not valid, and ":" normalises to an empty title.

I have yet to see a single page broken by this.

TMg: Link welcome.

mr.heat wrote:

Check [[Special:WhatLinksHere/Template:fullurl::]] in every MediaWiki installation, e.g. [[de:Special:WhatLinksHere/Template:fullurl::]]. And this is only the tip of the iceberg. See [[en:Special:WhatLinksHere/Template:fullurl:]], for example. I'm not even sure if all now broken uses of the fullurl syntax can be found that way.

Please note that users already started to fix the most annoying cases.

I really don't understand why you are refusing to accept this report. It's a broken functionality. You can confirm it very, very easily: Try to use [{{fullurl::|diff=90530056}}] on a random page. It does not work any more. Confirmed.

It's really, really simple:

This still is a perfectly valid URL:
https://de.wikipedia.org/w/index.php?title=&diff=90530056

In other words, it's allowed to use an empty title in an URL. It wouldn't make any sense to block such URLs because of the title.

Therefor this use of fullurl must be valid too:
{{fullurl:|diff=90530056}}

It doesn't make any sense to force a valid title if it's ignored anyway.

Same with the colon in {{fullurl::|diff=90530056}}. The colon separates namespaces and interwiki prefixes from the title. We are using empty prefixes regularly, e.g. in ":File:Example.jpg".

https://en.wikipedia.org/w/?title=Main_page is a valid URL.
https://en.wikipedia.org/w/?title=en:Main_page is a valid URL.
https://en.wikipedia.org/w/?title=:Main_page is a valid URL.
https://en.wikipedia.org/w/?title= is a valid URL.

Therefor https://en.wikipedia.org/w/?title=: must be valid to. It does not make sense to allow everything else but to block this specific case. It's an empty title (which is resolved to the main page) prefixed with a colon. We are used to this pattern when linking to a File or Category. Why block it? I don't care if you call it an "abuse" or "hack" or whatever. We are using it. Every single use had a meaning and a purpose and produced a working URL. There was no problem. Now it's broken.

(In reply to comment #12)

Check [[Special:WhatLinksHere/Template:fullurl::]] in every
MediaWiki installation, e.g.
[[de:Special:WhatLinksHere/Template:fullurl::]]. And this is only
the tip of the iceberg.

So I checked several large Wikipedias at random, including en, pl, es,
fr, zh, ja, it, sv, and the German Wikipedia seems to be literally the
*only* one having troubles with it – and what's more, they've already
fixed it by creating a template with that name (which is pretty
clever, I admit).

See [[en:Special:WhatLinksHere/Template:fullurl:]], for example. I'm
not even sure if all now broken uses of the fullurl syntax can be
found that way.

{{fullurl:|whatever}} has *never* worked, ever since that parser
function was introduced, as far as I know. The pages listed there seem
to be templates or incorrect usages of templates.

I really don't understand why you are refusing to accept this
report. It's a broken functionality. You can confirm it very, very
easily: Try to use [{{fullurl::|diff=90530056}}] on a random page.
It does not work any more. Confirmed.

I have already explained, but let me repeat: it was not expected to
work that way, and it not working anymore (which is a side-effect of
fixing a different bug) does not seem to be a big trouble for anyone
(but you, I guess).

Therefor https://en.wikipedia.org/w/?title=: must be valid to. It
does not make sense to allow everything else but to block this
specific case. It's an empty title (which is resolved to the main
page) prefixed with a colon.

An empty title is resolved to the main page in only one, very specific
case: when we're deciding what to do with the 'title' URL parameter
(or a rewrite rule that maps something else to the title parameter).
In every other case it's an invalid title (we even have unit tests for
this).

Therefore, ':', which follows the pattern you speak of, is also an
invalid title.

Sorry, I'll be unsubscribing from this bug, as I don't really care. Feel free to try to convince someone else to change this.

Community members in comment 3, comment 4 and comment 8 have explained why this request will not be fixed and why a patch would be not be accepted.
That translates to a WONTFIX which seems to describe well the reality. I don't think a rotting but open bug report that nobody will ever fix helps anybody.