From e0ee37e426900a9e6257168a650f2b7dfa5c73c5 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 27 Jun 2017 11:19:26 +0800 Subject: [PATCH] MDL-56046 dataformat: changes to docs, upgrade.txt and error message --- dataformat/json/classes/writer.php | 2 +- dataformat/upgrade.txt | 6 +++--- lib/dataformatlib.php | 4 ++-- lib/tablelib.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dataformat/json/classes/writer.php b/dataformat/json/classes/writer.php index fe741a6ae93..8e3cfbad1df 100644 --- a/dataformat/json/classes/writer.php +++ b/dataformat/json/classes/writer.php @@ -41,7 +41,7 @@ class writer extends \core\dataformat\base { /** @var $extension */ public $extension = ".json"; - /** @var $hasstarted */ + /** @var $sheetstarted */ public $sheetstarted = false; /** @var $sheetdatadded */ diff --git a/dataformat/upgrade.txt b/dataformat/upgrade.txt index 620e83a2da2..5868991c5ae 100644 --- a/dataformat/upgrade.txt +++ b/dataformat/upgrade.txt @@ -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(). diff --git a/lib/dataformatlib.php b/lib/dataformatlib.php index 44893cedf6f..fad18d6fd6a 100644 --- a/lib/dataformatlib.php +++ b/lib/dataformatlib.php @@ -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 { diff --git a/lib/tablelib.php b/lib/tablelib.php index 701267d4dfc..d1f1adc0b4e 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -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 {