Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed issue with pagination

  • Loading branch information...
commit e3f70b2d580163ac0ada90c568f61e21c0f348e3 1 parent 640ce78
@daylightstudio authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 fuel/modules/fuel/controllers/module.php
View
17 fuel/modules/fuel/controllers/module.php
@@ -373,6 +373,7 @@ protected function _list_process()
$mod_segs = explode('/',$this->module_uri);
$mod_offset_index = count($mod_segs) + 3;
$uri_params = uri_safe_batch_decode(fuel_uri_segment($mod_offset_index), '|', TRUE);
+ $uri_params['offset'] = (fuel_uri_segment($mod_offset_index)) ? (int) fuel_uri_segment($mod_offset_index) : 0;
$posted = array();
if (!empty($_POST))
@@ -382,7 +383,7 @@ protected function _list_process()
$posted_vars = array('col', 'order', 'limit', 'offset', 'precedence', 'view_type');
foreach($posted_vars as $val)
{
- if ($this->input->post($val)) $posted[$val] = $this->input->post($val);
+ if ($this->input->post($val)) $posted[$val] = $this->input->post($val, TRUE);
}
// custom module filters
@@ -392,17 +393,23 @@ protected function _list_process()
{
if (isset($_POST[$key]))
{
- $posted[$key] = $this->input->post($key);
- $this->filters[$key]['value'] = $this->input->post($key);
- $extra_filters[$key] = $this->input->post($key);
+ $posted[$key] = $this->input->post($key, TRUE);
+ $this->filters[$key]['value'] = $posted[$key];
+ $extra_filters[$key] = $posted[$key];
}
}
$posted['extra_filters'] = $extra_filters;
}
+ //$params = array_merge($defaults, $page_state, $uri_params, $posted);
$params = array_merge($defaults, $page_state, $uri_params, $posted);
- $params['offset'] = (fuel_uri_segment($mod_offset_index)) ? (int) fuel_uri_segment($mod_offset_index) : 0;
+
+ // reset offset if you apply a filter (via POST and not ajax)
+ if (!empty($_POST) and !is_ajax())
+ {
+ $params['offset'] = 0;
+ }
if ($params['search_term'] == lang('label_search')) $params['search_term'] = NULL;
/* PROCESS PARAMS END */
Please sign in to comment.
Something went wrong with that request. Please try again.