Page MenuHomePhabricator

If you don't fill in a poll type or encryption setting when creating a poll, the creation fails, but it doesn't tell you why
Closed, ResolvedPublic

Description

Usually when you skip a required field in the poll creation form, it says "This value is required." For the two radio button fields, however, it doesn't show such a message. Thus it is hard to figure out why the form submission failed.

This might actually be a bug with HTMLForm rather than SecureForm.

Related Objects

Event Timeline

kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari subscribed.
Huji added a subscriber: Platonides.

This seems to be more of a problem with HTMLForm; SecurePoll's include/pages/CreatePage.php uses that to create the form on poll creation page. The fields in question (Poll type, and Encryption) have a property 'required' => true and it is properly validated, yet HTMLForm fails to show a message next to the element when the validation fails. It only happens with radio buttons.

I can't think of other places were we generate radio buttons that are required, using the HTMLForm class. If one knows of an example, please share here. For now, I am also gonig to add HTMLForm tag.

Change 309920 had a related patch set uploaded (by Huji):
Display an error message when the validataion of a radio input fails because user did not provide any input.

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

Huji triaged this task as Low priority.

Change 309920 merged by jenkins-bot:
Display an error message when the validataion of a radio input fails because user did not provide any input.

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