Skip to content

Commit

Permalink
Some tweaks to getFilterArray() to allow EXISTS pre-filter condition to
Browse files Browse the repository at this point in the history
work.  Was failing if there were any list plugins on the same list
because ... well, just because.  It's Complicated.  See the code if you
care.
  • Loading branch information
cheesegrits committed Jul 24, 2014
1 parent 41439da commit 6ee1923
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions components/com_fabrik/models/list.php
Expand Up @@ -5068,7 +5068,7 @@ public function &getFilterArray()
}

// List plug-in filter found - it should have set its own sql in onGetPostFilter();
if (in_array($elid, $pluginKeys))
if (!empty($elid) && in_array($elid, $pluginKeys))
{
$this->filters['origvalue'][$i] = $value;
$this->filters['sqlCond'][$i] = $this->filters['sqlCond'][$i];
Expand All @@ -5088,23 +5088,23 @@ public function &getFilterArray()
$fullWordsOnly = $this->filters['full_words_only'][$i];
$exactMatch = $this->filters['match'][$i];

// $$ hugh - testing allowing {QS} replacements in pre-filter values
$w->replaceRequest($value);
$value = $this->prefilterParse($value);
$value = $w->parseMessageForPlaceHolder($value);

if (!is_a($elementModel, 'PlgFabrik_Element'))
{
if ($this->filters['condition'][$i] == 'exists')
{
$this->filters['sqlCond'][$i] = 'EXISTS (' . $this->filters['value'][$i] . ')';
$this->filters['sqlCond'][$i] = 'EXISTS (' . $value . ')';
}

continue;
}

$elementModel->_rawFilter = $raw;

// $$ hugh - testing allowing {QS} replacements in pre-filter values
$w->replaceRequest($value);
$value = $this->prefilterParse($value);
$value = $w->parseMessageForPlaceHolder($value);

if ($filterEval == '1')
{
// $$$ rob hehe if you set $i in the eval'd code all sorts of chaos ensues
Expand Down

0 comments on commit 6ee1923

Please sign in to comment.