Ticket #310 (new enhancement)
Change request for GenericORMController.cfc
| Reported by: | bigbadscottyb | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.0.x-next-patch |
| Version: | 2.0.304 | Severity: | normal |
| Keywords: | Cc: |
Description
I'm trying to leverage the already existing record validation you have built into ModelGlue? and Reactor.
I want to perform a data validation before the generic commit is called. I do that, and build a validation struct of array entries containing error messages, just like ModelGlue? does. I then want to call the generic commit, and append any error messages it finds to my already existing structure.
I would recommend changing line 155 in the ModelGlue?/unity/controller/GenericORMController.cfc to perform a check to see if a validation error message structure already exists, if so, just append the generic validation error messages to it, rather than overwriting it:
<cfif NOT arguments.event.ValueExists?(validationName)>
<cfset arguments.event.setValue(validationName, validation.getErrors()) />
<cfelse>
<cfset StructAppend?(arguments.event.getValue(validationName), validation.getErrors()) />
</cfif>
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)