Page MenuHomePhabricator

Inconsistent handling of missing Required values in TemplateWizard
Closed, ResolvedPublic3 Estimated Story Points


When a user attempts to Insert a template in which some of the Required values are missing, sometimes an error message is generated and sometimes not.

Steps to reproduce:

  1. From any wiki page, click Edit to open the wikitext editor.
  2. Make sure you are in Source Editing mode.
  3. Click the puzzle icon in the toolbar to open the TemplateWizard.
  4. Select any template with some required fields (Cite web for example).
  5. The result is different when you try to -
    • Fill the first required field and leave the second blank and click insert
      • The template saves without an error
    • Fill the second required field and leave the first blank and click insert
      • The user gets an overlay with the right text but the wrong title
    • Leave both fields empty and click Insert
      • Same as above. Right message, wrong title

Expected result: The user should always see a warning message about type mismatch when they try to save the template with any of the required fields empty. See T190231#4125795 and T191264
This is the expected messaging:

Actual result: Sometimes you get the wrong message, and sometimes you don't get one at all.

Note: If you leave ALL the Required fields blank, the error message always appears. But if you fill out some and leave others empty, that's when the inconsistent behavior happens.

Tried this on IE, Chrome, Safari and Firefox.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Barbvd Thanks for filing this ticket. I can reproduce the bug and I think I found out how to reproduce this more accurately.

Niharika triaged this task as Medium priority.Oct 3 2018, 9:26 PM
Niharika set the point value for this task to 3.Oct 9 2018, 11:38 PM
Niharika moved this task from To Be Estimated/Discussed to Estimated on the Community-Tech board.

Change 525228 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Validate fields correctly

Change 525228 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Validate fields correctly

dom_walden added a subscriber: dom_walden.

I could not reproduce on Firefox, Chromium, IE11 or Safari 11.

Regression-wise, I can still submit a valid form, or an invalid form if I click "Insert template" on the error page.

It should be noted that this fix applies to the TemplateWizard for the Source Editor interface. The TemplateWizard for the Visual Editor is slightly different, and seems not to have been affected by this bug. I did briefly test the latter, but found no problems.

(Switching to/from Visual Editor)