Skip to content

Commit

Permalink
Adding Search Tools specific BC checks to getUserStateFromRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker committed Jun 18, 2015
1 parent 260356d commit c44e0f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/legacy/model/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,18 @@ public function getUserStateFromRequest($key, $request, $default = null, $type =
$cur_state = (!is_null($old_state)) ? $old_state : $default;
$new_state = $input->get($request, null, $type);

// BC for Search Tools which uses different naming
if ($new_state === null && strpos($request, 'filter_') === 0)
{
$name = substr($request, 7);
$filters = $app->input->get('filter', array(), 'array');

if (!empty($filters[$name]))
{
$new_state = $filters[$name];
}
}

if (($cur_state != $new_state) && ($resetPage))
{
$input->set('limitstart', 0);
Expand Down

0 comments on commit c44e0f5

Please sign in to comment.