Skip to content

Commit

Permalink
Fix state sql (#44)
Browse files Browse the repository at this point in the history
* Fix broken State SQL

* Change qn => quoteName

* No need for an extra variable
  • Loading branch information
bembelimen authored and Janek committed Jul 21, 2017
1 parent 896ef8e commit 994d169
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ public static function getStatesSQL($fieldName, $workflowID)
$db = Factory::getDbo();
$query = $db->getQuery(true);

$select[] = $db->qn('id') . ' AS ' . $db->qn('value');
$select[] = $db->qn('title') . ' AS ' . $db->qn($db->escape($fieldName));

$query
->select($select)
->from($db->qn('#__workflow_states'))
->where($db->qn('workflow_id') . ' = ' . $workflowID);
->select($db->quoteName(['id', 'title'], ['value', $fieldName]))
->from($db->quoteName('#__workflow_states'))
->where($db->quoteName('workflow_id') . ' = ' . (int) $workflowID);

return (string) $query;
}
Expand Down

0 comments on commit 994d169

Please sign in to comment.