From 0d4b12e2da7d55daa63a411f1287261c19940c96 Mon Sep 17 00:00:00 2001 From: John van Breda Date: Mon, 2 Sep 2024 13:58:00 +0100 Subject: [PATCH 1/3] Removed debug log code --- modules/rest_api/libraries/RestApiElasticsearch.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/rest_api/libraries/RestApiElasticsearch.php b/modules/rest_api/libraries/RestApiElasticsearch.php index aebede7b6..4e83c3cb2 100644 --- a/modules/rest_api/libraries/RestApiElasticsearch.php +++ b/modules/rest_api/libraries/RestApiElasticsearch.php @@ -2298,7 +2298,6 @@ private function proxyToEs($url, $requestBody, $format, $ret, $requestIsRawStrin $response = curl_exec($session); $headers = curl_getinfo($session); $httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE); - kohana::log('error', 'Query: ' . $postData); if ($httpCode !== 200) { $error = curl_error($session); kohana::log('error', 'ES proxy request failed: ' . $error . ': ' . json_encode($error)); From 59e05610a489375b5bde42eec418b3f8939a620e Mon Sep 17 00:00:00 2001 From: John van Breda Date: Mon, 2 Sep 2024 14:06:30 +0100 Subject: [PATCH 2/3] Stream KML in chunks to avoid memory issues on large files https://github.com/BiologicalRecordsCentre/ABLE/issues/717 --- .../indicia_svc_data/controllers/data_service_base.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/indicia_svc_data/controllers/data_service_base.php b/modules/indicia_svc_data/controllers/data_service_base.php index 81214af51..02af6610e 100644 --- a/modules/indicia_svc_data/controllers/data_service_base.php +++ b/modules/indicia_svc_data/controllers/data_service_base.php @@ -158,7 +158,6 @@ protected function handle_request() { case 'kml': // Keyhole Markup Language. $this->kml_encode($records); - $this->content_type = 'Content-Type: application/vnd.google-earth.kml+xml'; break; case 'dwca': @@ -250,6 +249,10 @@ private function setHeaders($mode) { case 'tsv': header('Content-Type: text/tab-separated-values'); + break; + + case 'kml': + header('Content-Type: application/vnd.google-earth.kml+xml'); } if ($mode === 'csv') { // Prepend a byte order marker, so Excel recognises the CSV file as @@ -746,6 +749,10 @@ protected function kml_encode($array) { } echo $this->kml_encode_array($recordNum, $root, $recordArray, 2) . "\r\n"; $recordNum++; + // Output the buffer every 100 records. + if ($recordNum % 100 === 0) { + ob_flush(); + } } } echo " \n"; From bc97f8a2544935721961a8689ba1404dfb0f14a6 Mon Sep 17 00:00:00 2001 From: John van Breda Date: Mon, 2 Sep 2024 14:07:08 +0100 Subject: [PATCH 3/3] Version bump --- application/config/version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/config/version.php b/application/config/version.php index 9f3c363d5..50e1759d4 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -29,14 +29,14 @@ * * @var string */ -$config['version'] = '9.3.2'; +$config['version'] = '9.3.3'; /** * Version release date. * * @var string */ -$config['release_date'] = '2024-08-29'; +$config['release_date'] = '2024-09-02'; /** * Link to the code repository downloads page.