MDL-56046 dataformat: changes to docs, upgrade.txt and error message

This commit is contained in:
Mark Nelson 2017-06-27 11:19:26 +08:00
parent 7ad2822269
commit e0ee37e426
4 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@ class writer extends \core\dataformat\base {
/** @var $extension */
public $extension = ".json";
/** @var $hasstarted */
/** @var $sheetstarted */
public $sheetstarted = false;
/** @var $sheetdatadded */

View File

@ -4,9 +4,9 @@ information provided here is intended especially for developers.
=== 3.4 ===
* In order to allow multiple sheets in an exported file the functions write_header() and write_footer() have
been removed from core dataformats plugins and have been replaced.
- write_header() has been split into the two functions start_output() and start_sheet().
- write_footer() has been split into the two functions close_output() and close_sheet().
been removed from core dataformat plugins and have been replaced.
- write_header() has been replaced with the two functions start_output() and start_sheet().
- write_footer() has been replaced with the two functions close_output() and close_sheet().
For backwards compatibility write_header() and write_footer() will continue to work but if used will
trigger the function error_log().

View File

@ -58,7 +58,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca
$format->send_http_headers();
// This exists to support all dataformats - see MDL-56046.
if (method_exists($format, 'write_header')) {
error_log('The function write_header() does not support multiple tables. In order to support multiple tables you ' .
error_log('The function write_header() does not support multiple sheets. In order to support multiple sheets you ' .
'must implement start_output() and start_sheet() and remove write_header() in your dataformat.');
$format->write_header($columns);
} else {
@ -77,7 +77,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca
}
// This exists to support all dataformats - see MDL-56046.
if (method_exists($format, 'write_footer')) {
error_log('The function write_footer() does not support multiple tables. In order to support multiple tables you ' .
error_log('The function write_footer() does not support multiple sheets. In order to support multiple sheets you ' .
'must implement close_sheet() and close_output() and remove write_footer() in your dataformat.');
$format->write_footer($columns);
} else {

View File

@ -1774,7 +1774,7 @@ class table_dataformat_export_format extends table_default_export_format_parent
public function output_headers($headers) {
$this->columns = $headers;
if (method_exists($this->dataformat, 'write_header')) {
error_log('The function write_header() does not support multiple tables. In order to support multiple tables you ' .
error_log('The function write_header() does not support multiple sheets. In order to support multiple sheets you ' .
'must implement start_output() and start_sheet() and remove write_header() in your dataformat.');
$this->dataformat->write_header($headers);
} else {
@ -1797,7 +1797,7 @@ class table_dataformat_export_format extends table_default_export_format_parent
*/
public function finish_table() {
if (method_exists($this->dataformat, 'write_footer')) {
error_log('The function write_footer() does not support multiple tables. In order to support multiple tables you ' .
error_log('The function write_footer() does not support multiple sheets. In order to support multiple sheets you ' .
'must implement close_sheet() and close_output() and remove write_footer() in your dataformat.');
$this->dataformat->write_footer($this->columns);
} else {