diff --git a/Classes/Service/Resources/Excel.php b/Classes/Service/Resources/Excel.php index 5b8c4da..b488db8 100644 --- a/Classes/Service/Resources/Excel.php +++ b/Classes/Service/Resources/Excel.php @@ -7,7 +7,7 @@ use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Reader\IReader; -use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Core\Environment; /** * Description of Excel @@ -66,10 +66,10 @@ public function parseResource() $configuration = $this->getConfiguration(); if (!\class_exists(IOFactory::class)) { - throw new \Exception('PHP Excel is needed! Please install phpoffice/phpexcel (composer mode)', 12367812368); + throw new \Exception('PHP Excel is needed! Please install phpoffice/phpspreadsheet (composer mode)', 12367812368); } - $filename = GeneralUtility::getFileAbsFileName($this->filepath); + $filename = Environment::getPublicPath() . $this->filepath; /** @var IReader $reader */ $reader = IOFactory::createReaderForFile($filename); $reader->setReadDataOnly(true); @@ -88,7 +88,7 @@ public function parseResource() for ($row = 1 + $configuration['skipRows']; $row <= $highestRow; ++$row) { $rowRecord = []; for ($col = 0; $col <= $highestColumnIndex; ++$col) { - $rowRecord[] = \trim( + $rowRecord[] = \trim((string) $worksheet->getCellByColumnAndRow($col, $row) ->getValue() ); diff --git a/composer.json b/composer.json index 4d23ce1..7af1082 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "typo3/cms-core": "^10.4||^11.5" }, "suggest": { - "phpoffice/phpexcel": "Use Excel files as import resource" + "phpoffice/phpspreadsheet": "Use Excel files as import resource" }, "replace": { "typo3-ter/importr": "self.version"