Index: trunk/extensions/EducationProgram/includes/EPPager.php |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | $conds = array(); |
138 | 138 | |
139 | 139 | $filterOptions = $this->getFilterOptions(); |
140 | | - $this->addFilterValues( $filterOptions ); |
| 140 | + $this->addFilterValues( $filterOptions, false ); |
141 | 141 | |
142 | 142 | foreach ( $filterOptions as $optionName => $optionData ) { |
143 | 143 | if ( array_key_exists( 'value', $optionData ) && $optionData['value'] !== '' ) { |
— | — | @@ -261,10 +261,11 @@ |
262 | 262 | * @since 0.1 |
263 | 263 | * |
264 | 264 | * @param array $filterOptions |
| 265 | + * @param boolean $cast Should values with non-string type be casted (ie to have a select with int values have the correct val selected). |
265 | 266 | * |
266 | 267 | * @return boolean If anything was changed from the default |
267 | 268 | */ |
268 | | - protected function addFilterValues( array &$filterOptions ) { |
| 269 | + protected function addFilterValues( array &$filterOptions, $cast = true ) { |
269 | 270 | $req = $this->getRequest(); |
270 | 271 | $changed = false; |
271 | 272 | |
— | — | @@ -274,7 +275,7 @@ |
275 | 276 | $req->setSessionData( get_called_class() . $optionName, $optionData['value'] ); |
276 | 277 | $changed = true; |
277 | 278 | |
278 | | - if ( array_key_exists( 'datatype', $optionData ) ) { |
| 279 | + if ( $cast && array_key_exists( 'datatype', $optionData ) ) { |
279 | 280 | switch ( $optionData['datatype'] ) { |
280 | 281 | case 'int': |
281 | 282 | $optionData['value'] = (int)$optionData['value']; |