-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Undefined index $ : while importing excel file #687
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 be easily reproduced with: <?php
require 'vendor/autoload.php';
var_dump(\PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString('$A')); PR welcome to fix it |
@PowerKiKi i fixed it by removing "$" sign.
at line: /var/www/html/project/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php(1076): PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter->setRange('$A$1:$K$1') so the values passed within setRange is "A1:K1" and as we cant change the library directly so we added patch so that changes can persist themselves whenever we ran composer install or update. For now library is working okay. |
I created PR with suggested change and also added an Exception to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue is not fixed but closed. If a sheet contains autofilter it produces an error similar to |
I am facing the same issue :( |
i added above the way how to fix it and it is working all fine.. |
@yalwayzm33 yes, I saw. Thank you, by the way. But it's a bug and it would be great if the project was updated. Changing the source of third party software is not a good idea, but I'll do it until there is an update |
i know that thats why i added a patch it "and as we cant change the library directly so we added patch so that changes can persist themselves whenever we ran composer install or update." |
See the comments in #718 to create a PR that could be merged to fix this |
I had the same problem, but the error itself appeared in the Excel file itself, the format of the cell in which the text was located was like Number and this is not correct. Redid the cell format on Text and it worked. Check cell format. |
If this repository is abandoned and there's no maintainers who can solve such critical issues, please let users know about that (so that the package is highlighted with yellow in composer) rather than just keeping bug reports closed. |
@PowerKiKi #1326 is the PR but none is reviewing it. Could you help us please? |
The `setRange` method of the `Xlsx/AutoFilter` class expects a filter range format like "A1:E10". The returned value from `$this->worksheetXml->autoFilter['ref']` could contain "$" and returning a value like "$A$1:$E$10". Fixes PHPOffice#687 Fixes PHPOffice#1325 Closes PHPOffice#1326
The `setRange` method of the `Xlsx/AutoFilter` class expects a filter range format like "A1:E10". The returned value from `$this->worksheetXml->autoFilter['ref']` could contain "$" and returning a value like "$A$1:$E$10". Fixes PHPOffice#687 Fixes PHPOffice#1325 Closes PHPOffice#1326
This is:
What is the expected behavior?
Trying to import an excel file (.xlsx) and file should be imported without any error
What is the current behavior?
During import i am getting undefined index $ error (IOFactory::load method is throwing this error) when i searched it, its because of autoFilter being applied.
What are the steps to reproduce?
just upload an excel file downloaded through phpspreadsheet all filters applied (autoFilter are like this $A$1:$K$1 the dollar sign is creating problem when used in Coordinate.php line 291)
Which versions of PhpSpreadsheet and PHP are affected?
Latest
1.4.0
The text was updated successfully, but these errors were encountered: