Page MenuHomePhabricator

There is no possibility to check changes on user options save.
Closed, ResolvedPublic2 Estimated Story Points

Description

When user hits Save on Special:Preferences page MediaWiki core triggers 3 events

  • PreferencesFormPreSave
  • UserSaveOptions
  • UserSaveSettings

But all three events are triggered after setting new options in user object: https://github.com/wikimedia/mediawiki/blob/master/includes/Preferences.php#L1505
There is no possibility to compare new options with the one stored previously.

Context: we would like to track users who changed one option from enabled to disabled and trigger a bespoke action.

Pre-signoff Actions

Event Timeline

I'll reuse the existing PreferencesFormPreSave event, and add one parameter array $oldOptions which would be a set of user options before change

Change 363224 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/core@master] Pass old user options in PreferencesFormPreSave hook

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

phuedx triaged this task as High priority.Jul 5 2017, 10:01 AM

We determined this is a subtask and does not need estimation.

Change 363224 merged by jenkins-bot:
[mediawiki/core@master] Pass old user options in PreferencesFormPreSave hook

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

All that's left to be done is

Actually write the PreferencesFormPreSave documentation.

phuedx set the point value for this task to 2.
phuedx added a subscriber: Jdlrobson.

Reading Web didn't get around to estimating this yesterday. I'm being bold and estimating this as a 2. Any arguments for lower or higher? /cc @Jdlrobson

We actually agrees not to estimate as this was deemed to be a subtask.