tracker issue : CF-3038752

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 77630:(Watson Migration Closure)attributeColleciton with undefined arguments

| View in Tracker

Status/Resolution/Reason: Closed/Deferred/

Reporter/Name(from Bugbase): Devin Holloway / Devin Holloway (Devin Holloway)

Created: 06/01/2009

Components: Language, Tags

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Problem:

attributeColleciton with undefined arguments.

Passing the arguments scope to a tag's attributeCollection shouldn't pass undefined arguments into the attributeCollection.

I have the following code, basically a UDF for <cfdbinfo>:


<cffunction name="dbinfo" output="false" returntype="query">
<cfargument name="type" type="string" required="true">
<cfargument name="datasource" type="string" required="true">
<cfargument name="table" type="string" required="false">
<cfargument name="dbname" type="string" required="false">
<cfargument name="pattern" type="string" required="false">
<cfargument name="username" type="string" required="false">
<cfargument name="password" type="string" required="false">

<cfdump var="#arguments#" output="#ExpandPath(’dump.txt’)#">

<cfdbinfo name="local.dbinfo" attributeCollection="#arguments#">

<cfreturn local.dbinfo>
</cffunction>


All I’m passing to the UDF is type, datasource, and table. Dumping the arguments scope gives me this:

struct
DATASOURCE: eButterflies
DBNAME: undefined
PASSWORD: undefined
PATTERN: undefined
TABLE: login
TYPE: columns
USERNAME: undefined

Yet, when executing the UDF I get this error: "Value for attribute pattern is invalid. "

The "pattern" attribute is optional, and since it wasn’t passed into the UDF, I’d expect it to not be passed into the attributecollection. Either that, or, if it was passed into the attributecollection as undefined, the tag should ignore it and treat it as not passed in.



Method:

With the following UDF:

<cffunction name="dbinfo" output="false" returntype="query">
<cfargument name="type" type="string" required="true">
<cfargument name="datasource" type="string" required="true">
<cfargument name="table" type="string" required="false">
<cfargument name="dbname" type="string" required="false">
<cfargument name="pattern" type="string" required="false">
<cfargument name="username" type="string" required="false">
<cfargument name="password" type="string" required="false">

<cfdump var="#arguments#" output="#ExpandPath(’dump.txt’)#">

<cfdbinfo name="local.dbinfo" attributeCollection="#arguments#">

<cfreturn local.dbinfo>
</cffunction>

Pass in only the arguments type, datasource, and table.
Result:

Value for attribute pattern is invalid.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3038752

External Customer Info:
External Company:  
External Customer Name: Devin Holloway
External Customer Email: 5E060FD6422E831A992015D5
External Test Config: 06/01/2009

Attachments:

Comments:

This bug has been voted..
Vote by External U.
23665 | November 10, 2011 07:21:15 PM GMT