Page MenuHomePhabricator

Skin:WMAU: Validate and/or normalise wmau-config.json when saving
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
When editing the system message wmau-config.json, the types of values should be validated so that it fails errors out when invalid values are used prior to being saved, instead of failing after it is saved (and thus locking out all WMAU skin users on the wiki until it is fixed)

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
This would prevent fatal configuration issues from taking down the wiki, as seen in https://issue-tracker.miraheze.org/T13374

Benefits (why should this be implemented?):
It would prevent downtime since the misconfiguration wouldn't be saved :p

Details

Event Timeline

Restricted Application added a subscriber: Reception123. · View Herald Transcript

I suppose this can be implemented as a content handler? This would give us validateSave() to check types, and preSaveTransform() to also change icon_width to an integer if we so wish

Change #1196424 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/skins/WMAU@master] Guard against non-integer icon_width values

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

I think a content type is overkill for something that's only ever going to be a single page. I've fixed the issue with the icon_width values.

Sorry for the very slow response!

Change #1196424 merged by jenkins-bot:

[mediawiki/skins/WMAU@master] Guard against non-integer icon_width values

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

Samwilson claimed this task.