Page MenuHomePhabricator

Validation error for 'echo-subscriptions-email-flow-discussion': not a valid preference
Closed, ResolvedPublic

Description

For some reason Echo (Flow?) doesn't let me enable/disable email notifications using API. Here is a small JS code which works fine for other preferences (tested in the console of Google Chrome 36, on MetaWiki):

( new mw.Api() ).get( {
	action: 'tokens',
	type: 'options'
} )
.done( function ( data ) {
	( new mw.Api() ).post( {
		action: 'options',
		change: 'echo-subscriptions-email-flow-discussion=false',
		token: data.tokens.optionstoken
	} ) 
	.done( function ( data ) {
		console.log( data.warnings && data.warnings.options );
	} );
} );

I tried using "1", "true" and the empty string instead of "false". The result is always the same:

Object {*: "Validation error for 'echo-category-title-flow-discussion': not a valid preference"}

On the other hand, mw.user.options.get( 'echo-subscriptions-email-flow-discussion' ) returns the string "1" or the boolean false depending on the state of the check box in my preferences. The problem is just not being able to change that value using the API. The same code works fine if I try to set e.g. "language=fr" (from core) or "betafeatures-vector-compact-personal-bar=0" (from another extension).


Version: unspecified
Severity: normal
See Also:

Details

Reference
bz69146

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:37 AM
bzimport added a project: Notifications.
bzimport set Reference to bz69146.
bzimport added a subscriber: Unknown Object (MLST).

bsitu wrote:

'echo-category-title-flow-discussion' is not a preference, it's just a i18n key for the 'Flow' label

Sorry, I copied the wrong string. The problem is still the same if I use the correct keys which appear in http://meta.wikimedia.org/w/api.php?action=query&meta=userinfo&format=jsonfm&uiprop=options
{ *: "Validation error for 'echo-subscriptions-email-flow-discussion': not a valid preference" }

Change 151972 had a related patch set uploaded by Bsitu:
$checkmatrixOptions has an extra '-' in the key

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

Change 151972 merged by jenkins-bot:
Followup I4049b666: "Removing prefix exception for HTMLCheckMatrix"

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

All patches mentioned in this report were merged or abandoned - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?

matthiasmullie set Security to None.