-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Data validation produces unreadable file on 1.19 #2368
Comments
Fix issue PHPOffice#2368. PR PHPOffice#2265 moved the place where data validations were written to the worksheet. PR PHPOffice#1694 was installed afterwards, and accidentally restored the original location, so validations are now being written twice.
Fixed in master. Please test if possible. |
In my case, the fix on master fixes the issue described above. |
Tested an exported file opens fine on older versions of Excel for Windows and on Excel for Mac version 16.53. |
Will you be releasing a 1.19.1 release of phpspreadsheet? |
I am still facing issue with XLSM file type and MS Excel for Mac version 16.54. I am opening an XLSM file and updating a cell value with text and saving it as different file. $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filePath); |
I will have a new PR within the next couple of days. |
Attempt to deal with PHPOffice#2368, this time for good. Some deleted code was accidentally restored just before release 19, causing errors in spreadsheets with Data Validations. PR PHPOffice#2369 removed the duplicated code, and the fix was confirmed in current versions of Excel for Windows, Google sheets, and other versions of Excel. However, there were problems reported in earlier version of Excel for Windows, and some, versions of Excel for Mac, not all but including a recent one. This change, which is simpler than the original (no need for extLst) fix for DataValidations, is tested with Excel 2007 and Excel 2003 as well as more recent versions. I do not have a Mac on which to test.
I believe the PR 2375 should address the problems reported with some Excel versions since PR 2369. I don't have access to all those versions. If some of you who have problems can test against 2375, it would be helpful to know those results before 2375 is merged. |
No, there's a problem with that PR. It'll take a day or two to resolve. Sorry for the delay. |
Attempt to deal with PHPOffice#2368, this time for good. Some deleted code was accidentally restored just before release 19, causing errors in spreadsheets with Data Validations. PR PHPOffice#2369 removed the duplicated code, and the fix was confirmed in current versions of Excel for Windows, Google sheets, and other versions of Excel. However, there were problems reported in earlier version of Excel for Windows, and some, versions of Excel for Mac, not all but including a recent one. This change, which is simpler than the original (no need for extLst) fix for DataValidations, is tested with Excel 2007 and Excel 2003 as well as more recent versions. I do not have a Mac on which to test.
I am observing another issue with Data Validation. I have attached the sample xlsx(input and output) and the screenshot of xml tags from sheet1.xml. The xml doesn't have multiple entries for individual sets of validation. DataValidationIssueInput.xlsx |
Thank you for the sample files. I believe this problem has existed all along, and is not a regression. The input file declares a list of ranges for a single Data Validation entry, but PhpSpreadsheet is expecting only a single range. I will look into that. |
No, I am mistaken, the read routine is accounting for multiple ranges correctly. The write routine is trying to merge ranges in the Data Validation Collection, and that's where this problem is occurring. Investigating. |
The sqref field (the range for the validation) is not being used to compute the hash value for a Data Validation object, but it must be used to avoid merging distinct ranges. I will have a fix within a day or two. |
I believe my latest push (#2377) should address this problem, as well as the failure of some versions of Excel to read the Data Validations correctly. Please test if possible and let me know your results. |
Awesome that was quick. This fixed the issue. Thank you for the quick solution. |
* Support Data Validations in More Versions of Excel Attempt to deal with #2368, this time for good. Some deleted code was accidentally restored just before release 19, causing errors in spreadsheets with Data Validations. PR #2369 removed the duplicated code, and the fix was confirmed in current versions of Excel for Windows, Google sheets, and other versions of Excel. However, there were problems reported in earlier version of Excel for Windows, and some, versions of Excel for Mac, not all but including a recent one. This change, which is simpler than the original (no need for extLst) fix for DataValidations, is tested with Excel 2007 and Excel 2003 as well as more recent versions. I do not have a Mac on which to test. * Multiple Identical Data Validation Lists Using the same Data Validation List in multiple places on a worksheet caused them all to be merged into the same range. This was because sqref was not part of the hash code; it is now, avoiding this problem. * Must Write Data Validations Before Hyperlinks See discussion in #2389.
When is the next release expected? |
Fix working for me. Using Given the following code:
|
I think this issue should be closed then. @PowerKiKi Do you have time to release the 1.19.1 ? Thanks :) |
Fixed via da5c2b1, and released as 1.20.0 |
This is:
What is the expected behavior?
Data validation of type LIST to be applied on a range of cells and the file to opened by Excel. The below example works on 1.18
What is the current behavior?
Generated file can not be opened by excel
What are the steps to reproduce?
Which versions of PhpSpreadsheet and PHP are affected?
1.19
The text was updated successfully, but these errors were encountered: