Skip to content

Commit 3876eaf

Browse files
committed
fix issue #1356
1 parent 2f914a4 commit 3876eaf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Grid/Filter.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ public function disableIdFilter()
104104
$this->useIdFilter = false;
105105
}
106106

107+
/**
108+
* Remove ID filter if needed.
109+
*/
110+
public function removeIDFilterIfNeeded()
111+
{
112+
if (!$this->useIdFilter) {
113+
array_shift($this->filters);
114+
}
115+
}
116+
107117
/**
108118
* Get all conditions of the filters.
109119
*
@@ -129,6 +139,8 @@ public function conditions()
129139

130140
$conditions = [];
131141

142+
$this->removeIDFilterIfNeeded();
143+
132144
foreach ($this->filters() as $filter) {
133145
$conditions[] = $filter->condition($params);
134146
}
@@ -177,9 +189,7 @@ public function execute()
177189
*/
178190
public function render()
179191
{
180-
if (!$this->useIdFilter) {
181-
array_shift($this->filters);
182-
}
192+
$this->removeIDFilterIfNeeded();
183193

184194
if (empty($this->filters)) {
185195
return '';

0 commit comments

Comments
 (0)