Page MenuHomePhabricator

Changing the filter's group empties the selectorother fields for warn and disallow
Closed, ResolvedPublic

Description

To reproduce:

  • Enable Flow
  • Open Special:AbuseFilter/new
  • Check "Prevent the user from performing the action in question"
  • Note how both fields are filled
  • Change the filter group to "flow"
  • Note that the second field for "disallow" is now empty

Same for warn.

Event Timeline

So, this is partly intentional, see rEABF18bac6fed9d426aa0af36af964ba7fdea69ee7ed: it should be used to change the default message. However, it's affected by a bunch of bugs:

  • The IDs are #mw-abusefilter-action-checkbox-warn, not #mw-abusefilter-action-warn-checkbox ("warn" and "checkbox" are swapped)
  • Since we converted the form to use OOUI, it needs an extra input in the selector to get the checkbox, otherwise it gets a span which is never considered checked (or we might use variables for the OOUI elements, but that seems unnecessary for the time being)
  • The code doesn't check if the "new" message exists. For flow, it doesn't exist, so it ends up using undefined as the new value, which is obviously not what it should do

Change 660647 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Fix JS emptying warn/disallow message if filter group is changed

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

Change 660647 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Fix JS emptying warn/disallow message if filter group is changed

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