From fbba2776a1437b78f8999c612fcf6df39df5caa5 Mon Sep 17 00:00:00 2001 From: Torben Freudewald Date: Mon, 19 Aug 2024 17:26:21 +0200 Subject: [PATCH] [BUGFIX] Enable ExportTrait Events As the function was static the Events were not properly dispatched. To fix that the function will not be static anymore --- .github/workflows/ci.yml | 4 ++-- Classes/Traits/ExportTrait.php | 6 +++--- ext_emconf.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eae4dee..860d805 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - name: Check tag run: | - if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then + if ! [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then exit 1 fi @@ -46,7 +46,7 @@ jobs: - name: Install Dependencies - move old composer.json run: | mv composer.json composer.json-orig - composer require phpoffice/phpspreadsheet ^1.10 --ignore-platform-reqs --no-progress + composer require phpoffice/phpspreadsheet ^1.29 --ignore-platform-reqs --no-progress mv composer.json-orig composer.json rm composer.lock diff --git a/Classes/Traits/ExportTrait.php b/Classes/Traits/ExportTrait.php index 25e0988..2ebdfac 100644 --- a/Classes/Traits/ExportTrait.php +++ b/Classes/Traits/ExportTrait.php @@ -74,7 +74,7 @@ protected static function writeHeader(Worksheet $sheet, array $headerFields) * @param bool $autoFilter * @param array $hookArray @deprecated */ - protected static function writeExcel( + protected function writeExcel( Worksheet $sheet, array $dataset, array $exportFields, @@ -91,13 +91,13 @@ protected static function writeExcel( $colIndexer = 0; foreach ($exportFields as $colIndexer => $value) { $manipulateCellData = new ManipulateCellDataEvent($value, $currentData, $currentData[$value]); - if (!empty($this)) { + if (!empty($this->eventDispatcher)) { $this->eventDispatcher->dispatch($manipulateCellData); } $sheet->setCellValue(self::$cols[$colIndexer] . self::$rowCount, $manipulateCellData->getValue()); } $colIndexer++; - if (!empty($this)) { + if (!empty($this->eventDispatcher)) { $this->eventDispatcher->dispatch(new AddColumnsToSheetEvent($sheet, $colIndexer, self::$rowCount)); } if (array_key_exists($table, $hookArray) && is_array($hookArray[$table])) { diff --git a/ext_emconf.php b/ext_emconf.php index 8339f0f..86de3b2 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ 'author_company' => '', 'state' => 'beta', 'clearCacheOnLoad' => 0, - 'version' => '3.1.4', + 'version' => '3.1.5', 'constraints' => [ 'depends' => [ 'typo3' => '11.5.0-11.5.99',