A recent change to MediaWiki software seems to have broken templates everywhere. The syntax
[[:{{NAMESPACE}}:{{{1}}}|{{{1}}}]]
used to work on a template to generate a link to a page in the same namespace, typically used on templates related to move (rename) discussions.
However this has stopped working as of last month, causing lots of [[::ABC|ABC]] to be displayed in plain-text everywhere when this syntax is used in the main namespace.
We figured for now at yue.wp that [[{{NAMESPACE}}:{{{1}}}|{{{1}}}]] (notice the deletion of the colon at the beginning) works and would like to know if this is the recommended solution. This doesn't seem to have been picked up by Linter.
Related discussion on yue.wp: https://zh-yue.wikipedia.org/w/index.php?title=Wikipedia%3A%E5%9F%8E%E5%B8%8...
Deryck [[User:Deryck Chan]] Sysop & ambassador, yue.wp
I checked the recent changes to the parser code and this is likely the culprit: 0e1b52a4 "Make multiple colons escaping interlanguage links invalid, consistently" https://gerrit.wikimedia.org/r/#/c/361597/
Perhaps the change could be reverted, but given that (as you say) the problematic syntax is normally used in templates and not directly, perhaps the templates could be fixed instead.
Using "[[{{NAMESPACE}}:{{{1}}}|{{{1}}}]]" will not work correctly in the File and Category namespaces (it would generate a thumbnail or add the page to the category, respectively) – presumably the extra colon was to work around that. I would recommend the following:
[[{{#if:{{NAMESPACE}}|:{{NAMESPACE}}:}}{{{1}}}|{{{1}}}]]
Another common issue is templates is with the syntax [[:{{{1}}}|{{{1}}}]], where {{{1}}} is a page title that might be prefixed with a colon. This is often found in templates like {{softredirect}} or {{main}}.
I'm afraid the simplest solution is: {{#ifeq:{{padleft:|1|{{{1}}}}}|:|[[{{{1}}}]]|[[:{{{1}}}]]}}
This generates a normal link is the parameter {{{1}}} starts with a colon character, and a colon-prefix link otherwise.
On Sep 29, 2017, at 5:17 PM, Bartosz Dziewoński matma.rex@gmail.com wrote:
might be prefixed with a colon
Is there a reason why it only *might* be?
On 2017-09-29 23:52, Arlo Breault wrote:
On Sep 29, 2017, at 5:17 PM, Bartosz Dziewoński matma.rex@gmail.com wrote:
might be prefixed with a colon
Is there a reason why it only *might* be?
In the examples I saw, it was because it was never precisely documented whether it should be included, and until now both ways worked. Some users only passed the page name and some included the colon like they would do in a link.
On Sep 29, 2017, at 6:00 PM, Bartosz Dziewoński matma.rex@gmail.com wrote:
In the examples I saw, it was because it was never precisely documented whether it should be included, and until now both ways worked. Some users only passed the page name and some included the colon like they would do in a link.
In that case, I might prefer suggesting a documentation fix and updating use sites to the pad left solution, but I guess that depends on how pervasive it is.
On Oct 2, 2017, at 9:52 AM, Deryck Chan deryckchan@wikimedia.hk wrote:
I see that the linter has been deployed, but it doesn't seem to be picking up errors that result from template transcriptions, e.g. https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the template the caused the error has been changed since the MediaWiki breaking change.)
https://zh-yue.wikipedia.org/wiki/Special:LintErrors/multi-colon-escape shows no matches.
The short answer is that, currently, there needs to be an edit to a page (or template transcluded on the page) before the results will show up. T161556 is about reprocessing all pages.
https://www.mediawiki.org/wiki/Help:Extension:Linter#When_are_lint_errors_fo...
On Oct 2, 2017, at 9:52 AM, Deryck Chan deryckchan@wikimedia.hk wrote:
I see that the linter has been deployed, but it doesn't seem to be
picking up errors that result from template transcriptions, e.g. https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the template the caused the error has been changed since the MediaWiki breaking change.)
https://zh-yue.wikipedia.org/wiki/Special:LintErrors/multi-colon-escape
shows no matches.
The short answer is that, currently, there needs to be an edit to a page (or template transcluded on the page) before the results will show up. T161556 is about reprocessing all pages.
https://www.mediawiki.org/wiki/Help:Extension:Linter# When_are_lint_errors_for_a_page_updated.3F
Yea, for a linter to serve its intended purpose, it ought to exhaustively process every existing page upon deployment...
Deryck
I came across this template recently - https://zh-yue.wikipedia.org/wiki/Template:%E8%BB%9F%E5%BD%88
Any suggestions on how to fix this? This template forcefully prefixes a colon to make sure a link rather than an interwiki or a categorization or an image-load happens.
Deryck
On 4 October 2017 at 12:48, Deryck Chan deryckchan@wikimedia.hk wrote:
On Oct 2, 2017, at 9:52 AM, Deryck Chan deryckchan@wikimedia.hk wrote:
I see that the linter has been deployed, but it doesn't seem to be
picking up errors that result from template transcriptions, e.g. https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the template the caused the error has been changed since the MediaWiki breaking change.)
https://zh-yue.wikipedia.org/wiki/Special:LintErrors/multi-colon-escape
shows no matches.
The short answer is that, currently, there needs to be an edit to a page (or template transcluded on the page) before the results will show up. T161556 is about reprocessing all pages.
https://www.mediawiki.org/wiki/Help:Extension:Linter#When_ are_lint_errors_for_a_page_updated.3F
Yea, for a linter to serve its intended purpose, it ought to exhaustively process every existing page upon deployment...
Deryck
On 2017-11-02 20:27, Deryck Chan wrote:
I came across this template recently - https://zh-yue.wikipedia.org/wiki/Template:%E8%BB%9F%E5%BD%88
Any suggestions on how to fix this? This template forcefully prefixes a colon to make sure a link rather than an interwiki or a categorization or an image-load happens.
See my previous reply: https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2017-September/00...
I've recently found that the solution above causes errors when the template is transcluded onto another template: https://zh-yue.wikipedia.org/wiki/Template:%E5%A5%A7%E6%9E%97%E5%8C%B9%E5%85...
Offending template: https://zh-yue.wikipedia.org/wiki/Template:Mergefrom
Any advice? --Deryck
On 2 November 2017 at 20:37, Bartosz Dziewoński matma.rex@gmail.com wrote:
On 2017-11-02 20:27, Deryck Chan wrote:
I came across this template recently - https://zh-yue.wikipedia.org/w iki/Template:%E8%BB%9F%E5%BD%88
Any suggestions on how to fix this? This template forcefully prefixes a colon to make sure a link rather than an interwiki or a categorization or an image-load happens.
See my previous reply: https://lists.wikimedia.org/pi permail/wikitech-ambassadors/2017-September/001693.html
-- Bartosz Dziewoński
On May 1, 2018, at 1:52 PM, Deryck Chan deryckchan@wikimedia.hk wrote:
I've recently found that the solution above causes errors when the template is transcluded onto another template: https://zh-yue.wikipedia.org/wiki/Template:%E5%A5%A7%E6%9E%97%E5%8C%B9%E5%85...
Offending template: https://zh-yue.wikipedia.org/wiki/Template:Mergefrom
Any advice?
It looks like what you're running into is,
https://phabricator.wikimedia.org/T2529 https://phabricator.wikimedia.org/T14974
https://github.com/wikimedia/mediawiki/blob/b3f6d9f20f32f50902dc462ff5c46ee1...
so that, when a namespace is present, the output of the parser function starts with a colon, which gets pushed to a new line, breaking the wikilink syntax.
Is there a known method to get around this? The aim is to create a link with the given argument as page name and the namespace of the transcluding page as namespace.
Deryck
On Thu, 3 May 2018, 21:16 Arlo Breault, abreault@wikimedia.org wrote:
On May 1, 2018, at 1:52 PM, Deryck Chan deryckchan@wikimedia.hk wrote:
I've recently found that the solution above causes errors when the
template is transcluded onto another template:
https://zh-yue.wikipedia.org/wiki/Template:%E5%A5%A7%E6%9E%97%E5%8C%B9%E5%85...
Offending template: https://zh-yue.wikipedia.org/wiki/Template:Mergefrom
Any advice?
It looks like what you're running into is,
https://phabricator.wikimedia.org/T2529 https://phabricator.wikimedia.org/T14974
https://github.com/wikimedia/mediawiki/blob/b3f6d9f20f32f50902dc462ff5c46ee1...
so that, when a namespace is present, the output of the parser function starts with a colon, which gets pushed to a new line, breaking the wikilink syntax.
Wikitech-ambassadors mailing list Wikitech-ambassadors@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-ambassadors
On May 3, 2018, at 6:05 PM, Deryck Chan deryckchan@gmail.com wrote:
Is there a known method to get around this? The aim is to create a link with the given argument as page name and the namespace of the transcluding page as namespace.
Deryck
Well, for one, you could move the brackets `[[` insides the conditional, so that they're the first characters in the output of the template.
That seems to have worked. Thank you Arlo. https://zh-yue.wikipedia.org/w/index.php?title=Template%3AMergefrom&type...
--Deryck
On 4 May 2018 at 16:12, Arlo Breault abreault@wikimedia.org wrote:
On May 3, 2018, at 6:05 PM, Deryck Chan deryckchan@gmail.com wrote:
Is there a known method to get around this? The aim is to create a link
with the given argument as page name and the namespace of the transcluding page as namespace.
Deryck
Well, for one, you could move the brackets `[[` insides the conditional, so that they're the first characters in the output of the template.
Because if you prefix a wikilink link with a single colon it always works as a link regardless of namespace. And until the recent MediaWiki change two colons worked too, so if a template wants to accept both prefixed and unprefixed links, it can append a single colon to the front.
I see that the linter has been deployed, but it doesn't seem to be picking up errors that result from template transcriptions, e.g. https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the template the caused the error has been changed since the MediaWiki breaking change.)
https://zh-yue.wikipedia.org/wiki/Special:LintErrors/multi-colon-escape shows no matches.
On 29 September 2017 at 22:52, Arlo Breault abreault@wikimedia.org wrote:
On Sep 29, 2017, at 5:17 PM, Bartosz Dziewoński matma.rex@gmail.com
wrote:
might be prefixed with a colon
Is there a reason why it only *might* be?
Wikitech-ambassadors mailing list Wikitech-ambassadors@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-ambassadors
On Mon, Oct 2, 2017 at 9:52 AM, Deryck Chan deryckchan@wikimedia.hk wrote:
https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the
I just null edited the page linked and also {{mergefrom}} and now it appears on the lint report.
-Jeremy
Several dozen pages use that template[1] and only 2 of them are currently indexed on the lint report.
Does the linter eventually propagate to all pages automatically? Or will a page need to be (null) edited before it get picked up by the lint report?
[1] https://zh-yue.wikipedia.org/wiki/Special:%E9%82%8A%E5%BA%A6%E9%8F%88%E5%8E%...
On 2 October 2017 at 14:59, Jeremy Baron jeremy@tuxmachine.com wrote:
On Mon, Oct 2, 2017 at 9:52 AM, Deryck Chan deryckchan@wikimedia.hk wrote:
https://zh-yue.wikipedia.org/wiki/%E8%A9%A9 (Neither this page nor the
I just null edited the page linked and also {{mergefrom}} and now it appears on the lint report.
-Jeremy
Wikitech-ambassadors mailing list Wikitech-ambassadors@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-ambassadors
wikitech-ambassadors@lists.wikimedia.org