Page MenuHomePhabricator

About box editing for labels seems to have problems with functions that have ten+ arguments
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:

  • Input 2 label is given as “statement value type”, which is the text for Input 10, as can be seen in the “Try a function” section.
  • Other labels are displaced by one position
  • Input 10 is blank, consistent with Z23723K9 given for the ninth argument in “Try a function”.
  • Publishing with the inserted label does not have the intended result.

What should have happened instead?:

  • The labels should appear in numerical order, as in “Try a function”
  • It should be possible to save a label for the ninth argument (or, if saved, it should then be used)

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

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

Please also note this unusual WikiLambda system update, which would be expected to have updated only the implementation list.

Problems were also encountered with a different function, discussed here (Z23619). This comment relates

We seem to have lost the “tenth argument breaks the UI” angle. I’ll raise a separate ticket related to problems editing Z23724 and https://www.wikifunctions.org/wiki/Z23723?uselang=en&diff=prev&oldid=220982, noting https://www.wikifunctions.org/wiki/Talk:Z23619?uselang=en#Bug

(The “problem editing Z23724” arises from the change in the definition of Z6803 when keys were added to Z6003. It can be resolved by rebuilding the result validation from scratch. I created a new test (Z28547) and will propose deletion of Z23724 once the behaviour is confirmed to be “as expected”.)

From my edit here, it appears that arguments after the tenth are not handled at all, once they’ve been added. If there is some limit on the number of arguments that can be used, it should be enforced consistently and supported throughout the system.

Event Timeline

Jdforrester-WMF renamed this task from problems with functions that have ten arguments to About box editing for labels seems to have problems with functions that have ten+ arguments.Oct 1 2025, 5:47 PM
Jdforrester-WMF triaged this task as Medium priority.

@Jdforrester-WMF I’m not convinced that the problems are limited to the About box, although that’s a good place to start. Do you want a separate ticket for the unusual WikiLambda system update (deletion of labels), or does that have a simple explanation that eludes me?

DSmit-WMF changed the task status from Open to In Progress.Nov 25 2025, 1:51 PM

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

[mediawiki/extensions/WikiLambda@master] zfunction.js: Natural sort for Z{number}K{number} function arguments

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

The problem was on the frontend with sorting. We sort on the Frontend in 7 different places. 1 is inside 'getZFunctionInputLabels' which just did a simple sort but that does not take into account this specific type of sorting and would create the order of ZxK1, ZxK11,ZxK2,ZxK3 etc. Which is obviously not good. So thank you for flagging. I also checked the other 6 sorting functions and they are all used for different use cases. I didn't find another one that sorts ZxKx type of strings. I added a patch!

Change #1211125 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] zfunction.js: Natural sort the Z{number}K{number} function arguments

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

@GrounderUK I fixed the issue with the 9+ arguments. If ok, could you close this task?

Testing…

Looking good, thanks. Closing per request.

@GrounderUK I fixed the issue with the 9+ arguments. If ok, could you close this task?