You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [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?
Data validation flags like allowBlank, showDropDown, showInputMessage, and showErrorMessage flags are set correctly when reading in a XLSX
What is the current behavior?
Values are always set to false (except showDropDown which inverts the logic incorrectly and is always true)
What are the steps to reproduce?
Read in the XLSX file with data validations set with an input or error message, write file back out to a new XLSX file. Messages will be unset.
The code in PhpOffice\PhpSpreadsheet\Reader\Xlsx\DataValidations looks suspect. In load() the value for $dataValidation record is:
This is:
What is the expected behavior?
Data validation flags like allowBlank, showDropDown, showInputMessage, and showErrorMessage flags are set correctly when reading in a XLSX
What is the current behavior?
Values are always set to false (except showDropDown which inverts the logic incorrectly and is always true)
What are the steps to reproduce?
Read in the XLSX file with data validations set with an input or error message, write file back out to a new XLSX file. Messages will be unset.
The code in PhpOffice\PhpSpreadsheet\Reader\Xlsx\DataValidations looks suspect. In load() the value for $dataValidation record is:
however the resulting PhpOffice\PhpSpreadsheet\Cell\DataValidation Object becomes
$dataValidation is a SimpleXML object
therefore the loose comparison in PhpOffice\PhpSpreadsheet\Reader\Xlsx\DataValidations::load() will always be false
This is the same for other flags like showDropDown, showInputMessage, showErrorMessage
Additionally the logic for showDropDown is inverted (and then inverted again in the Xlsx writer)
Which versions of PhpSpreadsheet and PHP are affected?
Current release and master branch
The text was updated successfully, but these errors were encountered: