Skip to content

CellRange trimmed if from and to is equal, result in auto filter errors  #3102

Closed
@brainfoolong

Description

@brainfoolong

This is:

- [x] a bug report

I have found this line:

if ($this->from->cellAddress() === $this->to->cellAddress()) {

Which effectively convert a range into a single cell, which then causes errors in other functions that explicitely require a range cell name, even of the range consists of just one field.

So the result is, i cannot set AutoFilter with a range of one cell and it will throw an error

Cell get's converted here (__toString is called):

return (string) $cellAddress;

Error thrown here

throw new PhpSpreadsheetException('Autofilter must be set on a range of cells.');

Filter isset with:

public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2)

The current workaround is to use setAutoFilter instead of setAutoFilterByColumnAndRow and providing a string range.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions