Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xlsx multiple sheets #2243

Closed
522369235 opened this issue Jul 30, 2021 · 1 comment
Closed

Xlsx multiple sheets #2243

522369235 opened this issue Jul 30, 2021 · 1 comment

Comments

@522369235
Copy link

This is:

- [ ? ] a bug report
- [ × ] a feature request
- [ × ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Form(xlsx) the import

What is the current behavior?

The read XLSX table contains multiple worksheets, one of which uses an external link that does not exist, and an uncaught error occurs. (Illegal offset type)

What are the steps to reproduce?

I don't know how they made the form, but I can provide one.
The error occurs only on Linux servers.

<?php
        // use
        $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path);
        $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);

        'error_file' => '/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php',
        'error_line' => 884,
        'error_msg' => 'Illegal offset type'

        // Error location code
        // Loop through contents
        foreach ($commentsFile->commentList->comment as $comment) {
              if (!empty($comment['authorId'])) {
                  $docSheet->getComment((string) $comment['ref'])->setAuthor($authors[(string)$comment['authorId']]);
              }
              $docSheet->getComment((string) $comment['ref'])->setText($this->parseRichText($comment->text));
         }
         
        // In the end
        $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile($path);
        $spreadsheet->setReadDataOnly(true);
        $sheetData = $spreadsheet->load($import['word_path'])->getActiveSheet()->toArray(null, true, true, true);

Which versions of PhpSpreadsheet and PHP are affected?

PHP: 7.4.3
phpoffice/phpspreadsheet: 1.13

@522369235
Copy link
Author

522369235 commented Jul 30, 2021

to issue (#2227)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant