diff --git a/Grid/Grid.php b/Grid/Grid.php index b2f1e8fc..f7a52731 100644 --- a/Grid/Grid.php +++ b/Grid/Grid.php @@ -267,7 +267,7 @@ class Grid * @var string */ protected $defaultTweak; - + /** * Filters in session * @var array @@ -2008,7 +2008,7 @@ public function getRawData($columnNames = null, $namedIndexes = true) return $result; } - + /** * Returns an array of the active filters of the grid stored in session * @@ -2020,11 +2020,11 @@ public function getFilters() if ($this->hash === null) { throw new \Exception('getFilters method is only available in the manipulate callback function or after the call of the method isRedirected of the grid.'); } - + if ($this->sessionFilters === null) { $this->sessionFilters = array(); $session = $this->sessionData; - + $requestQueries = array( self::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED, self::REQUEST_QUERY_MASS_ACTION, @@ -2033,13 +2033,14 @@ public function getFilters() self::REQUEST_QUERY_LIMIT, self::REQUEST_QUERY_ORDER, self::REQUEST_QUERY_TEMPLATE, - self::REQUEST_QUERY_RESET + self::REQUEST_QUERY_RESET, + MassActionColumn::ID, ); - + foreach ($requestQueries as $request_query) { unset($session[$request_query]); } - + foreach ($session as $columnId => $sessionFilter) { if (isset($sessionFilter['operator'])) { $operator = $sessionFilter['operator']; @@ -2047,18 +2048,18 @@ public function getFilters() } else { $operator = $this->getColumn($columnId)->getDefaultOperator(); } - + if (! isset($sessionFilter['to'])) { $sessionFilter = $sessionFilter['from']; } - + $this->sessionFilters[$columnId] = new Filter($operator, $sessionFilter); } } - + return $this->sessionFilters; } - + /** * Returns the filter of a column stored in session * @@ -2072,12 +2073,12 @@ public function getFilter($columnId) if ($this->hash === null) { throw new \Exception('getFilters method is only available in the manipulate callback function or after the call of the method isRedirected of the grid.'); } - + $sessionFilters = $this->getFilters(); - + return isset($sessionFilters[$columnId]) ? $sessionFilters[$columnId] : null; } - + /** * A filter of the column is stored in session ? * @@ -2091,7 +2092,7 @@ public function hasFilter($columnId) if ($this->hash === null) { throw new \Exception('hasFilters method is only available in the manipulate callback function or after the call of the method isRedirected of the grid.'); } - + return getFilter($columnId) !== null; } }