Page MenuHomePhabricator

Improve pre-submission detection of empty references in the UI
Closed, ResolvedPublic

Description

Description

On pre-submission of new or edited zobjects, check if there is any Z9K1 which has an empty string and warn the user about it.

Desired behavior/Acceptance criteria

  • Submission should not be stopped
  • For every Z9K1 detected to have an empty value:
    • show a warning in the publishing dialog
    • show a error or warning state in the zreference field
    • force expansion of parent components if they contain an empty reference

Completion checklist

Event Timeline

I did some analysis and have a question.

  1. for Z14/Implementation: we now show the user underneath the field of the target function Z14K1 a message "Function is empty. Please select one" when Z14K1 is not filled. But this Z14K1 is an empty reference Z9K1. So if we would implement the above. Do we show both warnings or do we get rid of the specific warning for implementation. It is more specific so more useful. Or do we let the implementation message take precedence?
  2. Same goes for a tester function and the tester call and tester result validation.

I am going to assume the specific errors take precedence and will keep track of those using a validatedPaths array.

DSmit-WMF changed the task status from Open to In Progress.Sep 17 2025, 1:36 PM
DSmit-WMF claimed this task.

Another thing I noticed. currently it clears errors when the publish dialog is closed (cancelled). Which we should probable change right. Otherwise if you close the dialog, you do not see which fields had empty values

Screenshot 2025-09-17 at 16.36.01.png (906×1 px, 145 KB)

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

[mediawiki/extensions/WikiLambda@master] Add pre-submission validation for empty Z9K1 references

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

Current solution is not successfully keeping the Wikifunctions-Debug warning in the publish dialog.
Tested on converter page, where I can set some empty references and the code editor:

wikifunctions-debug.gif (876×976 px, 1 MB)

Change #1189253 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add pre-submission validation for empty Z9K1 references

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

Screenshot 2025-10-23 at 12.41.45.png (1×730 px, 76 KB)

Tested on wikifunctions.org and confirmed it works as expected