Description:
When logged into beta with AMC on and Javascript Off, adding a page to the watchlist prompts the user to click yes to "Remove from watchlist." Removing a page from the watchlist prompts the user to "Add to watchlist".
For a filled star (watched) on an article the url points to https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Qatar&action=watch but should point to action=unwatch
For an empty watchstar (unwatched) the url should be action=watch
Steps to Reproduce:
Navigate to a page on beta and click the watchstar icon.
Actual Results:
Clicking on the watchstar of a watched page prompts to be added to the watchlist.
Clicking on the watchstar of an un-watched page prompts to be removed from the watchlist.
Expected Results:
If the page was not on the watchlist it should prompt to be added.
If the page was on the watchlist it should prompt to be removed.
developer notes
The logic for creating the url is wrong and needs to be flipped.
protected function createWatchPageAction(): IMenuEntry { $title = $this->title; $user = $this->user; $isWatched = $title && $user->isLoggedIn() && $user->isWatched( $title ); $mode = $isWatched ? 'watch' : 'unwatch';
QA steps
Test on beta cluster e.g. https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Qatar