Page MenuHomePhabricator

Uncaught Error: Widget not found when editing filters
Closed, ResolvedPublic

Description

The Special:AbuseFilter editing form appears to currently be unusable. The JS console reports:

load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:158 Uncaught Error: Widget not found
    at Object.OO.ui.Element.static.unsafeInfuse (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:158)
    at Object.OO.ui.Element.static.infuse (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:158)
    at Object.OO.ui.infuse (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:154)
    at HTMLDocument.<anonymous> (<anonymous>:93:521)
    at mightThrow (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:48)
    at process (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=1ah9t:49)

I've observed this on group 0 and 1 wikis in safemode. Tested in Chromium 77 and Firefox 69 on Ubuntu.

Event Timeline

MusikAnimal added a subscriber: Daimona.

Some prompt attention would be appreciated. Looks like I can enable/disable filters, but I cannot change any actions or create new filters. @Daimona could you take a look?

I don't see any recent changes to AbuseFilter that explain this... perhaps it's a larger issue, or AbuseFilter needs updating following some recent change to OOUI?

The error traces back to https://gerrit.wikimedia.org/g/mediawiki/extensions/AbuseFilter/+/cdee6802ea2bc5a6c66534f929b08ae97d9c9a7f/modules/ext.abuseFilter.edit.js#447

There we are passing in $( '#mw-abusefilter-warn-preview-button' ) but this element isn't on the page. So the issue must be with whatever populates the "Actions to take" section of the form.

I think it might be due to this commit https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/commit/b9e4475985b04255c18953fd0a0cd094e1a70b11#diff-7b91fe952ae15c62842be2a75267f75d

We're missing any form element under "Actions to take" that isn't already set. For instance see https://meta.wikimedia.org/wiki/Special:AbuseFilter/145, the "Prevent the user..." checkbox is there, but not any other options. Meanwhile https://meta.wikimedia.org/wiki/Special:AbuseFilter/147 doesn't currently have any actions set, so we don't see any form elements.

@Daimona Perhaps we could revert that commit for the time being?

Ouch! I'm going to hotfix that - no need to revert that commit in its entirety. I'll also add a selenium test for actions. I think this should be a train blocker given that the form is unusable no matter what.

Change 545617 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Unbreak filter edit form

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

Daimona raised the priority of this task from High to Unbreak Now!.

Let's hold the train but not roll back for now.

Yeah no need to rollback, for sure. The fix is also pretty small and self-contained.

Change 545620 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@wmf/1.35.0-wmf.3] Unbreak filter edit form

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

Change 545617 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Unbreak filter edit form

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

Sorry, don't have time to deploy this right now; can someone else take this? Otherwise will be back around in ~4 hours' time.

I intended to deploy, but:

I intended to deploy, but:

Only groups 0-1 are affected right now, so enwiki is fine. If you browse to https://test.wikipedia.org while logged in, your account there will be auto-created, and I can make you a sysop if you'd like, so that you can test it too.

Only groups 0-1 are affected right now, so enwiki is fine.

Heh, right. Sorry, was not thinking clearly here.

If you browse to https://test.wikipedia.org while logged in, your account there will be auto-created, and I can make you a sysop if you'd like, so that you can test it too.

Sounds good, and I think we're clear to proceed.

Change 545620 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@wmf/1.35.0-wmf.3] Unbreak filter edit form

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

Mentioned in SAL (#wikimedia-operations) [2019-10-23T22:55:53Z] <brennen@deploy1001> Synchronized php-1.35.0-wmf.3/extensions/AbuseFilter: SWAT: [[gerrit:545620|Unbreak filter edit form (T236286)]] (duration: 01m 05s)