I did extend validation with the custom validation object. I am properly calling the superclass's validate method in my extension. I have even removed my custom validation from this scenario and am still encountering this issue.On Sep 14, 2006, at 7:57 AM, Mr. Darby wrote: Are you doing any custom validation with your record, or in other words, have you used the extended validation methods for your record to add custom errors?
On 9/13/06, Clint Miller <[EMAIL PROTECTED]> wrote: Yes, I'm aware of that but I'm curious as to why that's happening since the count() method of the error collection is returning 0 (zero).
Clint On Sep 13, 2006, at 3:38 PM, Brian Kotek wrote: hasErrors() returns true if the errorCollection has any errors in it.
On 9/13/06, Clint Miller <[EMAIL PROTECTED] > wrote: Beth, that's a great question. It's definitely an option, and if so, what's the purpose of the hasErrors() method of the record object. I have seen that used in validation in examples on this list.
Anyone else want to contribute? On Sep 13, 2006, at 11:15 AM, Beth Bowden wrote: should it be user._getErrorCollection().hasErrors()?
Beth
On 9/13/06, Clint Miller < [EMAIL PROTECTED] > wrote:I'm having some issues with Reactor validation. The user variable is a reactor record object. This is the scenario where I'm editing user information and saving the changes back to the DB. This anomaly occurs whether I actually have changes to save or not (i.e., I can just open the edit form, and do nothing but click save; or I can open the edit form, make changes, and click save).
<cfset arguments.event.trace("errors:", user.validated())> <cfset user.validate()> <cfset arguments.event.trace("errors:", user.validated())> <cfset arguments.event.trace("errors:", user._getErrorCollection ().count())> <cfset arguments.event.trace("errors:", user.hasErrors())> <cfset arguments.event.trace ("errors:", user._getErrorCollection ().getErrors())> <cfif NOT user.hasErrors()> <cfset user.save()> <cfset arguments.event.addResult("editSuccess")> <cfelse> <cfset arguments.event.setValue("editErrorCollection", user._getErrorCollection())> <cfset arguments.event.addResult("editError")> </cfif> When the code above runs, I'm seeing the output below from Model-Glue debugging:
16ms errors: NO
8672ms errors: YES
8672ms errors: 0
8672ms errors: true
8672ms errors: array [empty]
So the way I read that, the validated state is being set properly, there are no errors on the user object, but for some reason hasErrors () is returning true. Can anyone help me here? I've loaded up records outside my application (with a test CFM page) and they validate correctly (at least as I see it---the error collection count () returns 0 and hasErrors() returns false).
Thanks!
Clint Miller
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|