Maybe. But it might not be a good idea to start coding edge cases
into there. I'll take a look.
On Fri, Mar 23, 2012 at 9:30 AM, Robert Rawlins <rob
...@weboffins.com> wrote:
> Hi Bob,
> It's line 121 of ServerValidator.cfc that throws the exception.
> Basically when validating it calls val.PropertyExists() - if it doesn't then it throws the exception.
> I think you may be right, a slight change so that the property existing is only a requirement if you're using non-custom rules that will require the getter.
> Thanks.
> Rob
> On 23 Mar 2012, at 13:26, Bob Silverberg wrote:
>> Are you able to isolate the code in the fw that's causing a problem?
>> It does seem to me that if you are only doing a custom validation that
>> it shouldn't care whether the property exists or not, so maybe a fix
>> can be made which wouldn't require any defaults to change. I'll look
>> into it when I can, but I figured that if you've been looking at the
>> code maybe you can point out exactly where the problem is occurring.
>> Thanks,
>> Bob
>> On Fri, Mar 23, 2012 at 6:27 AM, Rawlins <rob...@supporttime.com> wrote:
>>> Hello Guys,
>>> I've got a strange issue which has crept in at some point. I have an object
>>> that has validation on a virtual property, this means the property
>>> doesn't technically exist (no getter/setter), but the rules that apply to it
>>> are all custom so it shouldn't need to invoke the property directly.
>>> <property name="NoRemainingStock" desc="No remaining stock">
>>> <rule type="custom" contexts="delete" failureMessage="You cannot delete a
>>> stock location whilst it still contains stock.">
>>> <param name="methodName" value="hasNoRemainingStock" />
>>> </rule>
>>> </property>
>>> When I try to validate this object I get an error:
>>> The property NoRemainingStock was not found in the object
>>> passed into the validation object.
>>> Now, I'm sure this was working several weeks ago when we built the feature,
>>> however, I believe at some point I may have upgraded the framework (from
>>> 0.99) and this issue obviously slipped through my testing.
>>> Looking through GitHub it seems that some work was done on a
>>> ignoreMissingProperty feature - that results in exceptions like this. It
>>> seems I have to now pass a new argument into the validate() method if my
>>> object has virtual properties like this, is that correct?
>>> If so, then this causes quite a lot of extra leg work for me as a developer
>>> as I use virtual properties like this quite extensively. Is it possible to
>>> suggest that we have the default for this setting as a framework wide
>>> configuration?
>>> Can anyone offer any advice / opinions?
>>> Thanks guys,
>>> Robert
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "ValidateThis" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/validatethis/-/hibB8I1G-XMJ.
>>> To post to this group, send email to validatethis@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> validatethis+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/validatethis?hl=en.
>> --
>> Bob Silverberg
>> www.silverwareconsulting.com
>> --
>> You received this message because you are subscribed to the Google Groups "ValidateThis" group.
>> To post to this group, send email to validatethis@googlegroups.com.
>> To unsubscribe from this group, send email to validatethis+unsubscribe@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/validatethis?hl=en.
> --
> You received this message because you are subscribed to the Google Groups "ValidateThis" group.
> To post to this group, send email to validatethis@googlegroups.com.
> To unsubscribe from this group, send email to validatethis+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/validatethis?hl=en.