Page MenuHomePhabricator

Prevent PageTriage from setting preferences for temporary accounts
Closed, ResolvedPublic


Following T335971, it appears the extension is saving preferences for temporary users.
Update the code to treat temporary users like anon users.

Wherever these do something different based on whether a user is anonymous or registered, they may need updating (including comments).

Tests and comments should also be updated.

To help with searching:

In PHP preferences are saved via UserOptionsManager::saveOptions
In JS preferences are saved via methods defined on options.js:

Items identified:

  • modules/ext.pageTriage.util/models/ext.pageTriage.article.js - change

if ( mw.user.isAnon() || !filterOptionsJson ) { to
if ( !mw.user.isNamed() || !filterOptionsJson ) {

  • modules/ext.pageTriage.util/models/ext.pageTriage.article.js - change

if ( !mw.user.isAnon() ) { to
if ( mw.user.isNamed() ) {

  • includes/Hooks.php - change

if ( !$user->isRegistered() ) { to
if ( !$user->isNamed() ) {

Event Timeline

(Please add codebase project tags to tasks when possible, so such tasks can be found when looking for open tasks related to that codebase - thanks!)

Niharika subscribed.

I tagged this with the Growth-Team but if that's not correct, please fix it.

jsn.sherman changed the task status from Open to In Progress.Sep 11 2023, 6:04 PM
jsn.sherman claimed this task.
jsn.sherman moved this task from PageTriage to Kanban on the Moderator-Tools-Team board.

Sorry for tag spam: I believe I used to be able to add both the Moderator-Tools-Team and the Moderator-Tools-Team (Kanban) tags, but now they seem mutually exclusive. Either I misremember how this is setup, or the behavior has changed.

Change 956913 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/PageTriage@master] only named accounts may set preferences

Change 956913 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] only named accounts may set preferences