Page MenuHomePhabricator

Fix handling of empty 'Publishers' field in NewsletterEditPage
Closed, ResolvedPublic

Description

The 'Publishers' field in NewsletterEditPage has required=false and exists=true. Before T246958, that means that it will not successfully submit if empty.

After T246958, this field will successfully submit if empty. NewsletterEditPage::getManageForm should return a confirmation warning if 'Publishers' is empty, but handles the empty input incorrectly, and an error is thrown from getIdsFromUsers.

Event Timeline

Change 580063 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/Newsletter@master] NewsletterEditPage: Fix handling of empty 'Publishers' field

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

Change 580063 merged by jenkins-bot:
[mediawiki/extensions/Newsletter@master] NewsletterEditPage: Fix handling of empty 'Publishers' field

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

dom_walden added a subscriber: dom_walden.

Testing on https://en.wikipedia.beta.wmflabs.org.

Special:Newsletter?action=edit:

InputJSNo JS
EmptyShows confirmation*; saves without publishersShows confirmation*; saves without publishers
Non-existent userShows confirmation*; saves without publishers"$user does not exist"
Existent userSaves existent user as publisherSaves existent user as publisher
Existent + non-existentOnly saves existent user as publishers"$user does not exist"

* "Are you sure that you want to remove all the publishers from this newsletter?"

For invalid input (e.g. "user|name") it behaves like non-existent user input on JS and non-JS.