Page MenuHomePhabricator

Trademark permission request form fails if the proposed use isn't "Other"
Closed, ResolvedPublic

Description

There is a contact form on Meta, linked from the Trademark Policy, that people can use to request permission to use a Wikimedia trademark:
https://meta.wikimedia.org/wiki/Special:Contact/requestlicense

However, it is no longer working—nothing happens when you hit the "send" button. No requests have come in through this form since August 3, 2017.

Event Timeline

CRoslof created this task.Aug 22 2017, 2:58 PM
Restricted Application added a project: User-bd808. · View Herald TranscriptAug 22 2017, 2:58 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
bd808 added a comment.Aug 22 2017, 3:13 PM

When I try to submit it I am getting a client-side "Please fill out this field" notification that is not obviously connected to any input on the form. Looking at the page source I found that the text input only shown when "Other" was selected as the proposed use was marked as required.

bd808 removed bd808 as the assignee of this task.Aug 22 2017, 3:13 PM
bd808 edited projects, added MediaWiki-extensions-ContactPage; removed User-bd808.
bd808 added a subscriber: bd808.

The form has worked in the past for requestors selecting one of the "proposed use" options other than "Other".

It's possible, but unlikely, that they all filled out the "Other" field then changed to a different proposed use option. No one has mentioned having to do so, though.

Jdlrobson added a comment.EditedAug 22 2017, 3:42 PM

There's a js error when I click submit:

An invalid form control with name='wpProposedUse-other' is not focusable.

I get the JS error An invalid form control with name='wpProposedUse-other' is not focusable. when I try to submit. Where is this form configured?

Reedy added a comment.Aug 22 2017, 3:44 PM

It's also worth noting it was probably also completely broken from the middle of July (when the patch above was merged) until 1st/2nd August due to the issues detailed in T172199

Jdforrester-WMF renamed this task from Fix trademark permission request form to Trademark permission request form fails if the proposed use isn't "Other".Aug 22 2017, 3:47 PM
Jdforrester-WMF triaged this task as Unbreak Now! priority.
Jdforrester-WMF removed a project: OOUI.
Restricted Application added subscribers: Liuxinyu970226, Jay8g, TerraCodes. · View Herald TranscriptAug 22 2017, 3:47 PM

OK, so, if I change the ProposedUse to "other" and fill in the other box it appears to send. It looks like it's trying to validate the hidden text box regardless of contents. This might be related to the HTMLForm changes around validation as well.

Reedy added a subscriber: Prtksxna.Aug 22 2017, 4:01 PM

Possibly @matmarex might understand this code.

Presumably caused by 8bd6605736c47259bd5f901284cbd2e639cef30c, which implemented the 'selectorother' HTMLForm field type in the OOUI mode. (Previously, it would fall back to the default mode, which worked fine – since it doesn't set the 'required' attribute – but probably looked out-of-place compared to the other fields on that page.)

We have code elsewhere to remove the 'required' attribute when hiding a form field, I'll look into adapting this. I haven't worked with this code recently, might take a couple of hours.

If we want to unbreak this now, the simple solution is to remove 'required' => true, from the definition for 'ProposedUse' in [operations/mediawiki-config]/wmf-config/MetaContactPages.php.

It would be fine with me to make the "other" field not required.

Change 373339 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] MetaContactPages: Temporarily de-require the trademark request's ProposedUse field

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

For reference, this is what the form looked like prior to the buggy change, using unstyled input boxes for this field:

Change 373343 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] mw.widgets.SelectWithInputWidget: Invisible invalid fields should not block form submission

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

As a side note, this contact form has "*" at the end of several field labels ("Username *", "Wikimedia chapter, thematic organization, or user group & title (if any) *"), presumably indicating that they are required – it would be nice to remove that and instead mark those fields with 'required' => true,. Both are simple text fields so there won't be any problems.

Reedy added a comment.Aug 23 2017, 8:11 PM

As a side note, this contact form has "*" at the end of several field labels ("Username *", "Wikimedia chapter, thematic organization, or user group & title (if any) *"), presumably indicating that they are required – it would be nice to remove that and instead mark those fields with 'required' => true,. Both are simple text fields so there won't be any problems.

Should just need the updates making to https://noc.wikimedia.org/conf/highlight.php?file=MetaContactPages.php and https://github.com/wikimedia/mediawiki-extensions-WikimediaMessages/blob/master/i18n/contactpage/en.json

As a side note, this contact form has "*" at the end of several field labels ("Username *", "Wikimedia chapter, thematic organization, or user group & title (if any) *"), presumably indicating that they are required – it would be nice to remove that and instead mark those fields with 'required' => true,. Both are simple text fields so there won't be any problems.

Should just need the updates making to https://noc.wikimedia.org/conf/highlight.php?file=MetaContactPages.php and https://github.com/wikimedia/mediawiki-extensions-WikimediaMessages/blob/master/i18n/contactpage/en.json

Done in https://gerrit.wikimedia.org/r/373371 and https://gerrit.wikimedia.org/r/373369 .

Change 373343 merged by jenkins-bot:
[mediawiki/core@master] mw.widgets.SelectWithInputWidget: Invisible invalid fields should not block form submission

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

Change 373391 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/core@wmf/1.30.0-wmf.15] mw.widgets.SelectWithInputWidget: Invisible invalid fields should not block form submission

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

Change 373339 abandoned by Jforrester:
MetaContactPages: Temporarily de-require the trademark request's ProposedUse field

Reason:
Skipping, MatmaRex fixed everything instead.

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

Change 373391 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.15] mw.widgets.SelectWithInputWidget: Invisible invalid fields should not block form submission

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

Jdforrester-WMF closed this task as Resolved.Aug 23 2017, 11:29 PM
Jdforrester-WMF assigned this task to matmarex.

OK, this should now work as before in production. In addition, the "name" field requirement is now enforced in code, not just copy.