[Rt-devel] Question about Magic values

Philip Kime pkime at Shopzilla.com
Thu Feb 22 23:19:16 EST 2007


I notice that some things seem to give two identical errors in the GUI-
like trying to modify a CF without the right permissions. It seems that
this has to do with this paragraph in 
 
RT::Interface::Web.pm:_ProcessObjectCustomFieldUpdates()
 
-------------
    foreach my $arg ( keys %{ $args{'ARGS'} } ) {
        # since http won't pass in a form element with a null value, we
need
        # to fake it
        if ( $arg eq 'Values-Magic' ) {
            # We don't care about the magic, if there's really a values
element;
            next if $args{'ARGS'}->{'Value'} ||
$args{'ARGS'}->{'Values'};
 
            # "Empty" values does not mean anything for Image and Binary
fields
            next if $cf_type =~ /^(?:Image|Binary)$/;
 
            $arg = 'Values';
            $args{'ARGS'}->{'Values'} = undef;
        }
-------------------
 
I've been trying to figure this out and it seems that it's guaranteed to
send every blank-valued "Value" or "Values" argument round what follows
twice. In the case of a "Value" argument, you dont' notice usually
because the $arg=Values; line means they pass through different
conditional branches below, one of which doesn't usually give an error.
But for a "Values" value, it goes through exactly the same code twice
and if there is an error, you see it twice. I just want to see if I'm
not missing anything here - it seems to me that you'll always go round
the same code twice with blank values? I'm guessing $args{'ARGS'} should
be pre-processed before this point to weed out duplicate
blankvalue/magic blank value pairs?
 
PK
 
--
Philip Kime
NOPS Systems Architect
310 401 0407
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20070222/b7de5463/attachment.htm


More information about the Rt-devel mailing list