Skip to content

Function hasValidValue Breaks Coordinates of Tested Cell #2262

Closed
@oleibman

Description

This is:

- [x] a bug report
- [ ] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

$testCell->hasValidValue() should not alter testCell.

What is the current behavior?

$testCell->hasValidValue() can alter testCell; in particular, it may wind up pointing to a cell with different coordinates than it had been pointing to.

What are the steps to reproduce?

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

DataValidatorTest already demonstrates the problem as illustrated by statements such as:

$testCell = $sheet->getCell('A1'); // redefine $testCell, because it has broken coordinates after using other cells

This is an easy enough workaround, but it should not be needed. The problem unfortunately happens way too deep in the Calculation engine for me to unravel.

Which versions of PhpSpreadsheet and PHP are affected?

All.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions