Page MenuHomePhabricator

Warn authors of code implementations that their “Z0”s will be substituted on initial publication
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
When publishing a new Python implementation containing the regular expression [a-zA-Z0-9]+, the “Z0” is replaced by the identifier of the new implementation.

What should have happened instead?:
No substitution, or a warning that substitution will occur.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Per the diff, a subsequent edit successfully resolves the substitution.

Event Timeline

Thanks!
We show this notice message in converter pages (e.g. https://www.wikifunctions.org/wiki/Special:CreateObject?zid=Z46)

Screenshot from 2025-11-27 19-20-50.png (675×924 px, 36 KB)

@GrounderUK Would it be useful to show it in normal code implementation ones, too?

Thanks!
We show this notice message in converter pages (e.g. https://www.wikifunctions.org/wiki/Special:CreateObject?zid=Z46)

Screenshot from 2025-11-27 19-20-50.png (675×924 px, 36 KB)

@GrounderUK Would it be useful to show it in normal code implementation ones, too?

I don’t think the magic is required for code implementations of functions at all. If we retain it, I think it would be better to mention it only when the “Z0” string is present, as a warning in the Publish dialogue. In any event, it would be helpful to clarify that the substitution can be reversed in a subsequent edit. I’m not aware of any similar situations, but as a general principle I think we should save what the user entered and make automatic amendments to that only in a subsequent edit. I don’t think we should put much effort into that at this stage, but if it should happen to be straightforward…

Change #1215569 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] ZCode:Show Z0 placeholder notice when code contains Z0

https://gerrit.wikimedia.org/r/1215569

Screenshot 2025-12-05 at 12.21.50.png (1×1 px, 96 KB)
Screenshot 2025-12-05 at 12.21.25.png (1×1 px, 117 KB)
type converter NEWimplementation NEW

if its ok I did it like this for now. I show it whenever Z0 is used and it will appear, removing Z0 and it will disappear.
I adjusted the message to tell the user it can be reverted in a subsequent edit. Does this help?

DSmit-WMF changed the task status from Open to In Progress.Dec 5 2025, 11:23 AM
DSmit-WMF claimed this task.

Thanks. Yes, that’s fine with me!

Change #1215569 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] ZCode:Show Z0 placeholder notice when code contains Z0

https://gerrit.wikimedia.org/r/1215569

Jdforrester-WMF renamed this task from Silent “Z0” substitution in a new Python implementation to Warn authors of code implementations that their “Z0”s will be substituted on initial publication.Dec 9 2025, 6:02 PM