Ok this has been stumping the crap out of me for quite some time and I’m wondering if anyone else has seen this problem.
It all has to do with IsValid() and using the “integer” validation. From my understanding an “integer” means a whole number and “numeric” means a float (has decimal places in it). With that said, I have an init() method that look like this:
<cffunction name=”init” access=”public” returntype=”ProgramAd” output=”false”>
<cfargument name=”id” type=”string” required=”true”>
<cfif IsValid(“integer”, arguments.id)>
Basically I pass in a string and if it’s a valid integer it will create the object and load the information in. If it isn’t, it just return a created object to me. Pretty basic stuff. Well here’s the kicker, when a pass in the value of “24” to the init() method from another CFC’s method, it won’t run the ReadObj() method. BUT if I change the IsValid() to “numeric” it works. Everything works cool if I try to create the object directly from a unit test template I have. I can’t figure this out and I’m wondering if anyone else has run into this. The real wacky thing is that I have this exact init() method in other CFCs and it works fine.
Anyone have an answer to this?
I did some searching around the net and found a post by Ray which describes a bug found in IsValid() ‘s “integer” validation. The thing is, the post is from July 2005, so you think that this would be fixed by now. Thanks again Adobe.