Skip to content

Commit 568d459

Browse files
PavelWeirichPavel W
and
Pavel W
authored
filterRange() in NetteDatabaseTableDataSource ignored the number zero (#1144)
Co-authored-by: Pavel W <[email protected]>
1 parent 936e103 commit 568d459

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataSource/NetteDatabaseTableDataSource.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ protected function applyFilterRange(FilterRange $filter): void
177177
$valueFrom = $conditions[$filter->getColumn()]['from'];
178178
$valueTo = $conditions[$filter->getColumn()]['to'];
179179

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

184-
if ($valueTo) {
184+
if ($valueTo !== '') {
185185
$this->dataSource->where(sprintf('%s <= ?', $filter->getColumn()), $valueTo);
186186
}
187187
}

0 commit comments

Comments
 (0)