I think I have managed to kill this bug. A diff patch for the rt cli is
attached.
There were two parts to the bug:
- multi-value fields were not getting parsed properly when attempting
to delete a value from the list
- when adding values back to a multi-value field, additional space
characters were inserted before the individual values
Part 1 was because of vsplit() splitting the values on a newline char
when they were actually being returned in the REST form as
comma-separated values. My first fix was to just split on commas, but I
then added the newline char back to the regex match. This should
provide flexibility and preserve any legacy code from other users.
Part 2 was in Form::compose() where new values were added back to the
multi-value list string separated by a comma and then a space. By
removing the space character from the append string, extra spaces are no
longer inserted.
This patch works with my own testing. Please try it for yourself and
make sure I haven’t broken any other functionality.
I hope others find this useful and that it is considered for inclusion
in the next release.
SethOn 04/15/2010 12:01 PM, Seth Galitzer wrote:
I brought this up with rt-bugs (ticket #14423) and it was suggested I
bring it up here, too.
Details are in the ticket, but the upshot is the cli does not deal with
multi-value custom fields very well. If you try to remove a value from
the list, unless it is the first one in the list, it is not removed.
Also, spaces are added to list values when a value fails to be removed.
I also noticed that when I try to add a value to a multi-value field,
spaces are added to the front of the added value, much like in the
erroneous delete I describe in the ticket.
My best guess is that there is a bug somewhere in the vsplit and/or
vpush subs, but I am not quite knowledgeable in perl enough yet to say
for sure.
We use the cli extensively in conjunction with custom fields in our
automated processes, so finding a fix for this is rather important.
I would be happy to help fix this in any way I can.
Thanks.
Seth
Seth Galitzer
Systems Coordinator
Computing and Information Sciences
Kansas State University
http://www.cis.ksu.edu/~sgsax
sgsax@ksu.edu
785-532-7790
rt.diff (748 Bytes)