Skip to content

Commit

Permalink
Use Grammar from Query in Widget List
Browse files Browse the repository at this point in the history
When using models with a different database software than the default, the old code produced a syntax error. 
Using the Grammar from the query ensures that the alias is always wrapped correctly. 

Suggestion: The code should be scanned for similar errors, produced by using DB Facade.
  • Loading branch information
CSNWEB committed Jan 10, 2016
1 parent 5a70cec commit aa5f37a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/backend/widgets/Lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function prepareModel()
continue;
}

$alias = Db::getQueryGrammar()->wrap($column->columnName);
$alias = $query->getQuery()->getGrammar()->wrap($column->columnName);

/*
* Relation column
Expand Down

0 comments on commit aa5f37a

Please sign in to comment.