Page MenuHomePhabricator

Watchlist Expiry: "Uncaught Error: Widget not found" JS error in edit page form when user is not logged in
Closed, ResolvedPublic

Description

When an user is not logged in, there is a JS error in the edit page form when watchlist expiry feature is turned on.

Uncaught Error: Widget not found

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Watchlist Expiry: Fix JS error in edit page form when user is not logged in to Watchlist Expiry: "Uncaught Error: Widget not found" JS error in edit page form when user is not logged in.Jul 20 2020, 8:24 PM

Change 615301 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@master] Fix js error on edit page when user is not logged in

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

Change 615301 merged by jenkins-bot:
[mediawiki/core@master] Fix js error on edit page when user is not logged in

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

@dmaza I notice the expiry dropdown is not disabled when the watch checkbox is unchecked.

I think here, document.getElementById( 'wpWatchThisWidget' ) needs to be document.getElementById( 'wpWatchthisWidget' ) (different capitalisation). The former returns null for me when I run it in the browser console on the edit page.

@dmaza I notice the expiry dropdown is not disabled when the watch checkbox is unchecked.

I think here, document.getElementById( 'wpWatchThisWidget' ) needs to be document.getElementById( 'wpWatchthisWidget' ) (different capitalisation). The former returns null for me when I run it in the browser console on the edit page.

Good catch. I’ll fix it. Thank you.

Change 616893 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@master] Fix expiry dropdown not getting disabled on edit page.

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

Change 616893 merged by jenkins-bot:
[mediawiki/core@master] Fix expiry dropdown not getting disabled on edit page.

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

Change 616970 had a related patch set uploaded (by Samwilson; owner: Dmaza):
[mediawiki/core@REL1_35] Fix js error on edit page when user is not logged in

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

Change 616970 merged by jenkins-bot:
[mediawiki/core@REL1_35] Fix js error on edit page when user is not logged in

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

While logged out, no watchlist related javascript gets loaded when editing or previewing. No issues editing with either source or visual editor.

While logged in, the dropdown in the source editor behaves the same way as it did in T248494.

In case of regression, I tested I could submit an edit via visual editor while logged in and it successfully permanently watched the page.

Test environment: https://en.wikipedia.beta.wmflabs.org MediaWiki 1.36.0-alpha (0fed18b) 06:34, 30 July 2020

Change 616893 merged by jenkins-bot:
[mediawiki/core@master] Fix expiry dropdown not getting disabled on edit page.

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

@dmaza Does this need to be backported as well?

Change 617582 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@REL1_35] Fix expiry dropdown not getting disabled on edit page.

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

Change 616893 merged by jenkins-bot:
[mediawiki/core@master] Fix expiry dropdown not getting disabled on edit page.

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

@dmaza Does this need to be backported as well?

Yes, thank you.

ifried closed this task as Resolved.EditedJul 31 2020, 6:15 PM
ifried added a subscriber: ifried.

I tested this issue, and I did not the previous error occur when trying to edit (as a not logged in user) when watchlist expiry was turned on (on testwiki). For this reason, I'm marking it as Done.

Change 617582 merged by jenkins-bot:
[mediawiki/core@REL1_35] Fix expiry dropdown not getting disabled on edit page.

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