change deprecated CSV export code

This commit is contained in:
Daniel Seifert 2021-11-11 09:34:30 +01:00
parent ac7ae90310
commit b5d6936074
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class Csv implements RendererInterface
$csv = $this->getCsv();
$csv->insertOne( $fieldNames );
$csv->insertAll( $rows );
return $csv->toString();
return method_exists($csv, 'getContent') ? $csv->getContent() : (string) $csv;
} catch (Exception $e) {
/** @var RenderException $newException */
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e );