Unexpected Namespacing in rels File #3722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3720. Third-party product created a spreadsheet which PhpSpreadsheet could not read because of unexpected namespacing in workbook.xml.rels.
The file which demonstrated the problem was attached to #3423, however I do not believe it was related to the original problem. Nevertheless, the original issue specifically called out Protection, so I put some Protection tests in the validation test for the fix. In doing so, I found that Style/Protection is particularly confusing. Its properties will often have the value
inherit
, which isn't all that helpful; and, even when thelocked
value isprotected
, the cell won't actually be locked unless the sheet is protected as well. Thehidden
property is even more obscure - it applies only to formulas, and refers to hiding the property on the formula bar, not in the cell. I have added methodsisLocked
andisHiddenOnFormulaBar
toCell
. I corrected the docs to explain this. And, as long as I was looking at the docs, I corrected some examples to usegetHighestDataRow/Column
rather thangetHighestRow/Column
, a frequent problem for users (e.g. #3721).As a side note, the change to Cell.php is my first use of the nullsafe operator. This is one of many new options available now that we require Php8.0+.
Note that, even with this change, the test file is not handled perfectly. The first visible sheet has two textboxes, and PhpSpreadsheet does not handle these. Although limited support for form controls was added with PR #3130, the form controls were expected to be found in vml files. In this spreadsheet, the forms are found in a drawing xml file, but the xml tags for the textboxes are not recognized by PhpSpreadsheet. If I can figure out how to handle them, and that is far from certain, it is possible that they might be handled better than the vml files. Regardless, that work will not be part of this PR. I will open a new issue about this after this change is merged.
This is:
Checklist:
Why this change is needed?
Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.