Skip to content

Calling .get() with options does not pass through the arguments when using quickService #266

Description

@grantcopley

I'm running into this with Quick v10.0.1 on an app that does not have a default datasource defined in Application.cfc (there are reasons we can't currently define a global datasource).

	userService = application.wirebox.getInstance( "quickService:User@someModule" );

	awaitingReview = userService
					.whereNotNull( "Awaiting_Approval_Date" )
					.whereNull( "Approved_Date" )
					.get();

I get the following error:

Attribute [datasource] is required when attribute [dbtype] is not [query] and no default datasource is defined

you can define a default datasource as attribute [defaultdatasource] of the tag cfapplication or as data member of the Application.cfc (this.defaultdatasource="mydatasource";)

The error remains even when I try passing the datasource with the .get() call.

	awaitingReview = userService
					.whereNotNull( "Awaiting_Approval_Date" )
					.whereNull( "Approved_Date" )
					.get( options = { "datasource": "MyDatasource" } );

Stacktrace:

lucee.runtime.exp.ApplicationException: Attribute [datasource] is required when attribute [dbtype] is not [query] and no default datasource is defined
	at lucee.runtime.tag.Query.doStartTag(Query.java:479)
	at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:67)
	at models.grammars.basegrammar_cfc$cf.udfCall1(/qb/models/Grammars/BaseGrammar.cfc:124)
	at models.grammars.basegrammar_cfc$cf.udfCall(/qb/models/Grammars/BaseGrammar.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:699)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:594)
	at lucee.runtime.SuperComponent.callWithNamedValues(SuperComponent.java:93)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1795)
	at modules_app.mssql2008grammar.models.mssql2008grammar_cfc$cf.udfCall(/modules_app/MSSQL2008Grammar/models/MSSQL2008Grammar.cfc:14)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:699)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
	at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1952)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1795)
	at models.query.querybuilder_cfc$cf.udfCallm(/qb/models/Query/QueryBuilder.cfc:3985)
	at models.query.querybuilder_cfc$cf.udfCall(/qb/models/Query/QueryBuilder.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:804)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1795)
	at models.query.querybuilder_cfc$cf.udfCallm(/qb/models/Query/QueryBuilder.cfc:3936)
	at models.query.querybuilder_cfc$cf.udfCall(/qb/models/Query/QueryBuilder.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:804)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1795)
	at models.query.querybuilder_cfc$cf.udfCalll(/qb/models/Query/QueryBuilder.cfc:3662)
	at models.query.querybuilder_cfc$cf.udfCall(/qb/models/Query/QueryBuilder.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1933)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1776)
	at models.quickbuilder_cfc$cf.udfCall2(/quick/models/QuickBuilder.cfc:352)
	at models.quickbuilder_cfc$cf.udfCall(/quick/models/QuickBuilder.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
	at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:786)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1776)
	at models.quickbuilder_cfc$cf.udfCall3(/quick/models/QuickBuilder.cfc:377)
	at models.quickbuilder_cfc$cf.udfCall(/quick/models/QuickBuilder.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:358)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:699)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
	at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1952)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866)
	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1795)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions