Steps to Reproduce:
Make a query with format CSV or JSON (these were the ones I tested, but the bug should affect all the export formats).
In order for the problem to happen, some debug options must be enabled in LocalSettings.php, In my LocalSettings.php I have the following:
// Debug errors error_reporting( -1 ); ini_set( 'display_errors', 1 ); $wgShowExceptionDetails = true; $wgShowDBErrorBacktrace = true; $wgShowSQLErrors = 1;
Actual Results:
We get the CSV or JSON data, but there are several PHP warnings appended at the end (which corrupt the format of the data).
The warnings, rendered in HTML, are like this one (I am getting 6 of them):
Expected Results:
CSV, JSON, or any other format without warnings appended at the end.
The problem is related to the OutputPage class. The special page that runs the exports (CargoExport.php) is first writing the headers and the output to php://output, but then the OutputPage class tries to write a page with his own headers. To fix the problem, the OutputPage class should be disabled, this is explained in https://www.mediawiki.org/wiki/Taking_over_output_in_your_special_page.