tracker issue : CF-3037966

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

Bug 76100:Validate attribute for cfproperty and CFC types

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 03/20/2009

Components: ORM Support

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 230944

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

Validate attribute for cfproperty and CFC types.

cfargument allows basic datatypes as well as cfc datatypes in the "type" attribute. However, a cfproperty only allows the basic datatypes for its implicit setter. That makes it impossible (without creating an explicit setter) to validate a one-to-one setter.

If you were to add  @validate Profile, you’ll get an error. If you leave off the @validate attribute, you’re allowed to pass *anything* to setProfile()  and you don’t get any errors... at least not until you try to save it.

Along the same lines, I’m assuming you’re also not allowed to validate a one-to-many setter such as using @validate Photo[]

We should have all the same validation arguments as the cfargument type property so we don’t have to resort to explicit setters.

The current work around is to create an explicit setter.


Method:

/**
* @fieldtype one-to-one
* @cfc Profile
* @cascade all
* @validate Profile
*/
property Profile profile;
Result:

Invalid validate value Profile for property profile. Valid values are: any, boolean, date, numeric, string, struct, UUID, GUID, integer, float eurodate, time, creditcard, email, ssn, telephone, zipcode, regex.

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

Watson Bug ID:	3037966

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: Devin Holloway
External Customer Email: 5E060FD6422E831A992015D5
External Test Config: 03/20/2009

Attachments:

Comments: