Skip to content

Commit

Permalink
fixed - querystring filters using join=OR and grouped_to_previous wer…
Browse files Browse the repository at this point in the history
…e not working once the list had been paginated to a subsequent page
  • Loading branch information
pollen8 committed Jul 29, 2015
1 parent 1791792 commit 1b8a6ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions components/com_fabrik/models/element.php
Expand Up @@ -4053,8 +4053,9 @@ protected function getFilterHiddenFields($counter, $elName, $hidden = false, $no
$match = $this->isExactMatch(array('match' => $element->filter_exact_match));
$return = array();
$eval = FArrayHelper::getValue($filters, 'eval', array());
$joins = FArrayHelper::getValue($filters, 'join', array());
$condition = FArrayHelper::getValue($filters, 'condition', array());

$groupedTo = FArrayHelper::getValue($filters, 'grouped_to_previous', array());
/*
* Element filter not found (could be a prefilter instead) so use element default options
* see http://fabrikar.com/forums/index.php?threads/major-filter-issues.37360/
Expand All @@ -4070,16 +4071,19 @@ protected function getFilterHiddenFields($counter, $elName, $hidden = false, $no
$eval = FArrayHelper::getValue($eval, $filterIndex, FABRIKFILTER_TEXT);
}

$join = FArrayHelper::getValue($joins, $filterIndex, 'AND');
$groupedToPrevious = FArrayHelper::getValue($groupedTo, $filterIndex, '0');

// Need to include class other wise csv export produces incorrect results when exporting
$prefix = '<input type="hidden" class="' . $class . '" name="fabrik___filter[list_' . $this->getListModel()->getRenderContext() . ']';
$return[] = $prefix . '[condition][' . $counter . ']" value="' . $condition . '" />';
$return[] = $prefix . '[join][' . $counter . ']" value="AND" />';
$return[] = $prefix . '[join][' . $counter . ']" value="' . $join . '" />';
$return[] = $prefix . '[key][' . $counter . ']" value="' . $elName . '" />';
$return[] = $prefix . '[search_type][' . $counter . ']" value="normal" />';
$return[] = $prefix . '[match][' . $counter . ']" value="' . $match . '" />';
$return[] = $prefix . '[full_words_only][' . $counter . ']" value="' . $params->get('full_words_only', '0') . '" />';
$return[] = $prefix . '[eval][' . $counter . ']" value="' . $eval . '" />';
$return[] = $prefix . '[grouped_to_previous][' . $counter . ']" value="0" />';
$return[] = $prefix . '[grouped_to_previous][' . $counter . ']" value="' . $groupedToPrevious . '" />';
$return[] = $prefix . '[hidden][' . $counter . ']" value="' . $hidden . '" />';
$return[] = $prefix . '[elementid][' . $counter . ']" value="' . $element->id . '" />';

Expand Down
1 change: 0 additions & 1 deletion components/com_fabrik/models/list.php
Expand Up @@ -6109,7 +6109,6 @@ public function getFilters($container = 'listform_1', $type = 'list', $id = '',
{
$app = JFactory::getApplication();
$profiler = JProfiler::getInstance('Application');
$params = $this->getParams();
$this->viewfilters = array();
JDEBUG ? $profiler->mark('fabrik makeFilters start') : null;
$modelFilters = $this->makeFilters($container, $type, $id, $ref);
Expand Down

0 comments on commit 1b8a6ed

Please sign in to comment.