[rt-devel] missing ValidateValue method
falcone at bestpractical.com
Tue Nov 11 14:41:11 EST 2014
On Tue, Nov 11, 2014 at 12:54:01PM +0100, Christian Loos wrote:
> playing around with CustomFieldValues I noticed that you can add
> arbitrary values for CustomFields of type select.
> RT::Record->_AddCustomFieldValue calls ValidateValue  on a
> CustomField, but this method doesn't exist.
> Everything I can found is that this method was added with  in 2002
> and then removed with  in 2005.
> No one is missing this method except me since the last 9 years? ;-)
You're running into the fact that DBIx::SearchBuilder will bless
ValidateAnything into existence (you'll see a comment in the AUTOLOAD
code for it explaining that is used to use Accessible to do so, but
doesn't do that any more).
See for example
use RT -init;
my $ticket = RT::Ticket->new(RT->SystemUser);
Unfortunately, the commit message which removed ValidateValue is
essentially useless, so I have no idea why it was removed.
I'd certainly support a 4.4 change that brought back CustomField->ValidateValue,
but it would have to be clever about the same canonicalization used in
HasEntry and friends (think of "tomorrow" entered in date CFs).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 221 bytes
Desc: not available
More information about the rt-devel