Title:
Bug 83955:(Watson Migration Closure)Dynamic "required" attribute for <cfargument>In some cases it would be handy to be able to specify dependencies between function arguments
| View in TrackerStatus/Resolution/Reason: Closed/Deferred/
Reporter/Name(from Bugbase): Sebastian Zartner / Sebastian Zartner (Sebastian Zartner)
Created: 08/26/2010
Components: Language
Versions: 9.0.1
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Minor / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
Dynamic "required" attribute for <cfargument>In some cases it would be handy to be able to specify dependencies between function arguments. Therefore the "required" attribute needs to be set dynamically, which is not possible at the moment (maybe also the value of the "default" attribute just be used, if "required" is set to "false").So if the dependency is not matched ("required" dynamically set to true and parameter not defined), an error will be thrown like e. g. "The 'parameter name' parameter is required for function 'xyz' depending on 'condition'".See the steps for a small test case.
Method:
<cffunction name="test"> <cfargument name="element" type="any" required="yes"> <cfargument name="key" type="string" required="#isStruct(type)#"> <cfargument name="index" type="numeric" required="#isArray(type)#" default="1"> <!--- Do something ---></cffunction>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041944
External Customer Info:
External Company:
External Customer Name: Sebastian Zartner
External Customer Email: 4E7365D64550DB12992015D5
External Test Config: 08/26/2010
Attachments:
Comments: