Missing ValidateValue method

Hi,

playing around with CustomFieldValues I noticed that you can add
arbitrary values for CustomFields of type select.

RT::Record->_AddCustomFieldValue calls ValidateValue [1] on a
CustomField, but this method doesn’t exist.
Everything I can found is that this method was added with [2] in 2002
and then removed with [3] in 2005.

No one is missing this method except me since the last 9 years? :wink:

Chris

[1] https://github.com/bestpractical/rt/blob/stable/lib/RT/Record.pm#L1988
[2] https://github.com/bestpractical/rt/commit/f86edd0
[3] https://github.com/bestpractical/rt/commit/fc805c1

I am :-).

Playig with the REST interface I’ve seen the values I send for CF choosable by ‘Select’, are not recognized as an option, but as another new value not in the provided list (even when they have the same text).De: rt-devel [rt-devel-bounces@lists.bestpractical.com] en nombre de Christian Loos [cloos@netcologne.de]
Enviado: martes, 11 de noviembre de 2014 12:54
Para: rt-devel@lists.bestpractical.com
Asunto: [rt-devel] missing ValidateValue method

Hi,

playing around with CustomFieldValues I noticed that you can add
arbitrary values for CustomFields of type select.

RT::Record->_AddCustomFieldValue calls ValidateValue [1] on a
CustomField, but this method doesn’t exist.
Everything I can found is that this method was added with [2] in 2002
and then removed with [3] in 2005.

No one is missing this method except me since the last 9 years? :wink:

Chris

[1] https://github.com/bestpractical/rt/blob/stable/lib/RT/Record.pm#L1988
[2] https://github.com/bestpractical/rt/commit/f86edd0
[3] https://github.com/bestpractical/rt/commit/fc805c1

En cumplimiento de la Ley Orgánica 15/1999, de 13 de diciembre, de Protección de Datos de Carácter Personal, los datos personales reflejados en este documento se incluirán en una base de datos informatizada de titularidad de Centro Regional de Servicios Avanzados, S.A. Dicha base de datos se encuentra inscrita en el Registro General de Protección de Datos conforme a lo dispuesto en la legislación vigente y cumpliendo todas las medidas de seguridad del Real Decreto 994/1999, de 11 de junio, de medidas de seguridad de los ficheros automatizados que contengan datos de carácter personal. Asimismo, el cliente dispone en todo momento de los derechos de información, acceso, rectificación, cancelación y oposición, que podrá ejercitar por escrito mediante carta dirigida al Responsable de Seguridad, en la siguiente dirección: C/ López Bravo, 1. 09001 Burgos (España).

playing around with CustomFieldValues I noticed that you can add
arbitrary values for CustomFields of type select.

RT::Record->_AddCustomFieldValue calls ValidateValue [1] on a
CustomField, but this method doesn’t exist.
Everything I can found is that this method was added with [2] in 2002
and then removed with [3] in 2005.

No one is missing this method except me since the last 9 years? :wink:

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);
print $ticket->ValidateAnything;

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).

-kevin