Here is my usersValidator.cfc and my usersGateway.cfc both work perfect, sorry for troubling everyone. I am not sure why but it started working today, may have been because it was in production mode.

<cfcomponent hint="I am the validator object for the users object.  I am generated, but not overwritten if I exist.  You are safe to edit me."
    extends="reactor.project.scfsinc.Validator.usersValidator">
    <!--- Place custom code here, it will not be overwritten --->
   
    <cffunction name="validateUsername" access="public" hint="I validate the username field" output="true" returntype=" reactor.util.ErrorCollection">
        <cfargument name="UserRecord" hint="I am the UserRecord to validate." required="no" type="reactor.project.scfsinc.Record.UsersRecord" />
        <cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="reactor.util.ErrorCollection " default="#createErrorCollection(arguments.UserRecord._getDictionary())#" />
        <cfset var UserGateway = _getReactorFactory().createGateway("Users") />
       
        <cfset super.validateUsername(arguments.UserRecord, arguments.ErrorCollection) />
       
        <!--- validate username is unique if we are adding a new user --->
        <cfif arguments.userRecord.getUserId () EQ 0>
            <cfif UserGateway.validateUserName(arguments.UserRecord.getUserName())>
                <cfset arguments.ErrorCollection.addError("users.username.duplicate") />
            </cfif>
        </cfif>
       
        <cfreturn arguments.ErrorCollection />
    </cffunction>
   
    <cffunction name="validateEmailAddress" access="public" hint="I validate an email address" output="false" returntype=" reactor.util.ErrorCollection">
        <cfargument name="UserRecord" hint="I am the UserRecord to validate." required="no" type="reactor.project.scfsinc.Record.UsersRecord" />
        <cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="reactor.util.ErrorCollection " default="#createErrorCollection(arguments.UserRecord._getDictionary())#" />
       
        <cfset super.validateEmailAddress(arguments.UserRecord, arguments.ErrorCollection)>
       
        <cfif arguments.userRecord.getEmailAddress() NEQ arguments.userRecord.getEmailAddress2() OR len(trim(arguments.userRecord.getEmailAddress() EQ 0))>
            <cfset arguments.ErrorCollection.addError (users.emailaddress.notequal)>
        </cfif>
       
        <cfreturn arguments.ErrorCollection />
    </cffunction>

    <cffunction name="validatePassword" access="public" hint="I validate an email address" output="false" returntype=" reactor.util.ErrorCollection">
        <cfargument name="UserRecord" hint="I am the UserRecord to validate." required="no" type="reactor.project.scfsinc.Record.UsersRecord" />
        <cfargument name="ErrorCollection" hint="I am the error collection to populate. If not provided a new collection is created." required="no" type="reactor.util.ErrorCollection " default="#createErrorCollection(arguments.UserRecord._getDictionary())#" />
       
        <cfset super.validateEmailAddress(arguments.UserRecord, arguments.ErrorCollection)>
       
        <cfif arguments.userRecord.getPassword() NEQ arguments.userRecord.getPassword2() OR len(trim(arguments.userRecord.getPassword() EQ 0))>
            <cfset arguments.ErrorCollection.addError(users.password.notequal )>
        </cfif>
       
        <cfreturn arguments.ErrorCollection />
    </cffunction>
   
</cfcomponent>


<cfcomponent hint="I am the database agnostic custom Gateway object for the users object.  I am generated, but not overwritten if I exist.  You are safe to edit me."
    extends="reactor.project.scfsinc.Gateway.usersGateway" >
    <!--- Place custom code here, it will not be overwritten --->
   
    <cffunction name="Authenticate" access="public" output="false" returntype="boolean">
        <cfargument name="username" type="string" required="true">
        <cfargument name="password" type="string" required="true">
        <cfset var qAuth = "">
       
        <cfquery name="qAuth" datasource="#_getConfig().getDsn()#">
            select    userId
            from    users
            where    username = <cfqueryparam value="#arguments.username#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
            and        password = <cfqueryparam value="#arguments.password#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
        </cfquery>
           
        <cfreturn qAuth.recordCount gt 0>
    </cffunction>

    <cffunction name="validateUserName" access="public" hint="I look for other users with the same username.  True if found, false if not." output="true" returntype="boolean">
        <cfargument name="userName" hint="I am the username ot check for." required="yes" type="string" />
        <cfset var qValidate = "" />
       
        <cfquery name="qValidate" datasource="#_getConfig().getDsn()#" username="#_getConfig().getUsername()#" password="#_getConfig().getPassword()#">
            SELECT username
            FROM users
            WHERE username = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="50" value="#arguments.userName#" />
        </cfquery>
       
        <cfreturn qValidate.recordcount IS 1 />
    </cffunction>
</cfcomponent>

On 8/3/06, Dan Vega < [EMAIL PROTECTED]> wrote:
damn production mode, i got it fixed, thanks so much for your time and help Tom.

On 8/3/06, Dan Vega < [EMAIL PROTECTED] > wrote:
There should be no other queries affecting this because if I take out the custom validation it works fine.

On 8/3/06, Tom Chiverton < [EMAIL PROTECTED]> wrote:
On Thursday 03 August 2006 15:45, Dan Vega wrote:
> This error is happening when I try to add a new record and the validation
> is called, this is the query in the usersValidator.cfc which eventually

What I meant was to check all the other querys that have been called up to
this point.

--
Tom Chiverton

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF.  A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be confidential or legally privileged.  If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents.  If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --




--
Dan Vega
[EMAIL PROTECTED]

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to