PhpSpreadsheet icon indicating copy to clipboard operation
PhpSpreadsheet copied to clipboard

fix: Handle `null` value for `$plotGroupingType` in `writePlotGroup`

Open homersimpsons opened this issue 1 year ago • 5 comments

This is:

  • [x] a bugfix
  • [ ] additional unit tests

Checklist:

  • [ ] Changes are covered by unit tests
    • [ ] Changes are covered by existing unit tests
    • [ ] New unit tests have been added
  • [x] Code style is respected
  • [ ] Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • [ ] CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • [ ] Documentation is updated as necessary

Why this change is needed?

Fixes #3975

homersimpsons avatar Apr 06 '24 12:04 homersimpsons

Note that I am not aware enough about the internals to create a concise enough unit test (without relying on an external file), but I would happily use some guidance.

homersimpsons avatar Apr 06 '24 13:04 homersimpsons

Sometimes our tests do need to rely on an external file. Do you have an input file which demonstrates the problem when you load and then try to save it? If so, we can use that to construct a unit test.

oleibman avatar Apr 15 '24 01:04 oleibman

Sometimes our tests do need to rely on an external file. Do you have an input file which demonstrates the problem when you load and then try to save it? If so, we can use that to construct a unit test.

Yes I have such file in #3975: example_plot_grouping_type_null.xlsx

homersimpsons avatar Apr 21 '24 17:04 homersimpsons

Thank you for the sample file. You are correct that your fix eliminates the exception; however, the file that is produced is corrupt (error message when Excel opens it). So your change needs something more. I will take a look, but it may take several days before I can get to it.

oleibman avatar Apr 21 '24 20:04 oleibman

however, the file that is produced is corrupt (error message when Excel opens it).

Okay, so it looks like google sheet has an issue then.

So your change needs something more. I will take a look, but it may take several days before I can get to it.

No worries, I found this bug while investigating another one so I'm not facing it. I put some details in https://github.com/PHPOffice/PhpSpreadsheet/issues/3975 about my analysis of the issue.

homersimpsons avatar Apr 21 '24 21:04 homersimpsons