Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | aude | T389857 Run validation on charts before render | |||
| Resolved | BUG REPORT | CCiufo-WMF | T389126 Possible to break a page with invalid data | ||
| Resolved | BUG REPORT | CCiufo-WMF | T389125 Possible to break a page by passing in a chart that is not a JSON |
Event Timeline
Change #1130720 had a related patch set uploaded (by Aude; author: Aude):
[mediawiki/extensions/Chart@master] WIP - Handle invalid json data pages in chart parser function
JCDataContent::getLocalizedData does a validation check and may return null if the data is invalid.
We are missing a check for this (null value) for both tabular data content and chart definition content.
Also, there is an overall lack of tests in the Chart extension. I can add tests for these specific cases but it would be good to add more test coverage in general in the extension.
Change #1132000 had a related patch set uploaded (by Aude; author: Aude):
[mediawiki/extensions/Chart@master] Handle invalid json data pages in chart parser function
Change #1132000 merged by jenkins-bot:
[mediawiki/extensions/Chart@master] Handle invalid json data pages in chart parser function [bugfix only]
Change #1133573 had a related patch set uploaded (by Aude; author: Aude):
[mediawiki/extensions/Chart@master] Add tests for charts with invalid tabular data
Change #1130720 abandoned by Aude:
[mediawiki/extensions/Chart@master] Handle invalid json data pages in chart parser function
Reason:
Replaced by 1133573 for the tests
Let's break out the testing into a separate task (maybe as part of T390103) so that we can move forward with signing off on the fix.
This seems to have fixed T389126, although I'm not sure why the page renders with "⧼chart-error-invalid-source-content⧽".
From https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=Data:Break.chart:
It doesn't seem to fix T389125 though, I'm still getting a MediaWiki internal error at https://commons.wikimedia.beta.wmflabs.org/wiki/Data:1993_Canadian_federal_election_localized.chart.
Change #1133573 abandoned by Aude:
[mediawiki/extensions/Chart@master] Add tests for charts with invalid tabular data
