-
Notifications
You must be signed in to change notification settings - Fork 3.6k
TypeError: Illegal offset type in file Xlsx.php on line xxx #2316
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
Comments
Can you supply a test file which demonstrates this problem? |
Thank you for replying. Here is the link: https://drive.google.com/file/d/1gP1gLFOjDOd8ccScAGYMyYJ-0zYEkMdZ/view?usp=sharing I checked out the code and found that if I use
|
Thank you for supplying the test file. I can confirm that your problem happens with the current release of PhpSpreadsheet. However, there have been changes to master, and I believe that it handles your spreadsheet correctly. Are you able to test against master to confirm? |
Thank you. I will test it again later. |
Hello, |
This change was suggested by issue PHPOffice#2316. There was a problem reading Xlsx comments which appeared with release 18.0 but which was already fixed in master. So no source change was needed to fix the issue, but I thought we should at least add the test case to our unit tests. In developing that case, I discovered that, although comment text was read correctly, there was a problem with comment author. In fact, there were two problems. One was new, with the namespacing changes - as in several other cases, the namespaced attribute `authorId` needed some special handling. However, another problem was much older - the code was checking `!empty($comment['authorId'])`, eliminating consideration of authorId=0, and should instead have been checking `isset`. Both problems are now fixed, and tested.
It's okay after upating to master branch. |
This change was suggested by issue #2316. There was a problem reading Xlsx comments which appeared with release 18.0 but which was already fixed in master. So no source change was needed to fix the issue, but I thought we should at least add the test case to our unit tests. In developing that case, I discovered that, although comment text was read correctly, there was a problem with comment author. In fact, there were two problems. One was new, with the namespacing changes - as in several other cases, the namespaced attribute `authorId` needed some special handling. However, another problem was much older - the code was checking `!empty($comment['authorId'])`, eliminating consideration of authorId=0, and should instead have been checking `isset`. Both problems are now fixed, and tested.
This is:
What is the expected behavior?
Load .xlsx file without error.
What is the current behavior?
TypeError: Illegal offset type in file xxxxx/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 962
What are the steps to reproduce?
Create a spreadsheet from Google Doc, then download it to local disk.
Load the .xlsx file.
Which versions of PhpSpreadsheet and PHP are affected?
1.18
I trace the bug and see this
Should check the blue part instead of red part.
I comment out the line and thing goes good now. But I think it should be fixed in here instead of modifying the vendor code.
The text was updated successfully, but these errors were encountered: