PHPOffice / PhpSpreadsheet

A pure PHP library for reading and writing spreadsheet files
https://phpspreadsheet.readthedocs.io
MIT License
13.36k stars 3.47k forks source link

Impossible loading a XLSX file using a Xlsx Reader #1320

Closed astronati closed 4 years ago

astronati commented 4 years ago

This is:

- [x] 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?

The reader of the XLSX should load the XLSX file without the error mentioned below.

What is the current behavior?

File: src/File/Reader/Provider/SpreadsheetProvider.php

$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
return $reader->load($filename);

I receive following error message:

Notice: Undefined index: $","trace":"#0 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php(198): PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate::columnIndexFromString('$A')
#1 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php(108): PhpOffice\\PhpSpreadsheet\\Cell\\Coordinate::rangeBoundaries('$A$1:$BC$77')
#2 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php(32): PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter->setRange('$A$1:$BC$77')
#3 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php(25): PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\AutoFilter->readAutoFilter('$A$1:$BC$77', Object(SimpleXMLElement))
#4 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php(783): PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\AutoFilter->load()
#5 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php(93): PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx->load('/tmp/5e1ee67f17...')
#6src/File/Reader/Provider/SpreadsheetProvider.php(25): PhpOffice\\PhpSpreadsheet\\IOFactory::load('/tmp/5e1ee67f17...')

Which versions of PhpSpreadsheet and PHP are affected?

from 1.7 to 1.10.1

astronati commented 4 years ago

It will be fixed by https://github.com/PHPOffice/PhpSpreadsheet/pull/1326

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.

oleibman commented 4 months ago

Fixed by PR #1326.