Skip to content

Commit

Permalink
fix(QueryBuilder): Explicit arguments scoping
Browse files Browse the repository at this point in the history
Adds explicit argument scope in insert() for compatibility when Lucee is run in "modern" localmode
  • Loading branch information
mjclemente authored Jan 24, 2022
1 parent ced5d2a commit b5c1070
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/Query/QueryBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2476,18 +2476,18 @@ component displayname="QueryBuilder" accessors="true" {
* @return query
*/
public any function insert( required any values, struct options = {}, boolean toSql = false ) {
if ( values.isEmpty() ) {
if ( arguments.values.isEmpty() ) {
return;
}

if ( !isArray( values ) ) {
if ( !isStruct( values ) ) {
if ( !isArray( arguments.values ) ) {
if ( !isStruct( arguments.values ) ) {
throw(
type = "InvalidSQLType",
message = "Please pass a struct or an array of structs mapping columns to values"
);
}
values = [ values ];
arguments.values = [ arguments.values ];
}

var columns = arguments.values[ 1 ]
Expand Down

0 comments on commit b5c1070

Please sign in to comment.