Skip to content

Commit

Permalink
filterRange() in NetteDatabaseTableDataSource ignored the number zero (
Browse files Browse the repository at this point in the history
…#1144)

Co-authored-by: Pavel W <[email protected]>
  • Loading branch information
PavelWeirich and Pavel W authored Aug 23, 2024
1 parent 936e103 commit 568d459
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataSource/NetteDatabaseTableDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ protected function applyFilterRange(FilterRange $filter): void
$valueFrom = $conditions[$filter->getColumn()]['from'];
$valueTo = $conditions[$filter->getColumn()]['to'];

if ($valueFrom) {
if ($valueFrom !== '') {
$this->dataSource->where(sprintf('%s >= ?', $filter->getColumn()), $valueFrom);
}

if ($valueTo) {
if ($valueTo !== '') {
$this->dataSource->where(sprintf('%s <= ?', $filter->getColumn()), $valueTo);
}
}
Expand Down

0 comments on commit 568d459

Please sign in to comment.