Resolved gh-376 to insure that the usergroup filter work as expected

This commit is contained in:
Llewellyn van der Merwe 2019-03-10 00:29:38 +02:00
parent c9d9f8b7a8
commit b0084e6634
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5

View File

@ -10626,7 +10626,8 @@ class Interpretation extends Fields
$function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);";
// check if usergroup as we change to an object query // check if usergroup as we change to an object query
if ($filter['type'] === 'usergroup') { if ($filter['type'] === 'usergroup')
{
$function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text.";
$function[] = $this->_t(2) . "\$query->select(\$db->quoteName('g." . $filter['code'] . "', 'id'));"; $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('g." . $filter['code'] . "', 'id'));";
$function[] = $this->_t(2) . "\$query->select(\$db->quoteName('ug.title', 'title'));"; $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('ug.title', 'title'));";
@ -10637,7 +10638,9 @@ class Interpretation extends Fields
$function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object.";
$function[] = $this->_t(2) . "\$db->setQuery(\$query);"; $function[] = $this->_t(2) . "\$db->setQuery(\$query);";
$function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadObjectList();"; $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadObjectList();";
} else { }
else
{
$function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text.";
$function[] = $this->_t(2) . "\$query->select(\$db->quoteName('" . $filter['code'] . "'));"; $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('" . $filter['code'] . "'));";
$function[] = $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));"; $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));";
@ -10647,7 +10650,6 @@ class Interpretation extends Fields
$function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadColumn();"; $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadColumn();";
} }
$function[] = PHP_EOL . $this->_t(2) . "if (\$results)"; $function[] = PHP_EOL . $this->_t(2) . "if (\$results)";
$function[] = $this->_t(2) . "{"; $function[] = $this->_t(2) . "{";