Bug? TSV data includes HTML br tags

RT 3.8.10

Fields of type “Select Multiple” (at least) are exporting
via “Spreadsheet” with an HTML
tag separating
each item selected.

RT 3.8.10

Fields of type “Select Multiple” (at least) are exporting
via “Spreadsheet” with an HTML
tag separating
each item selected.

Nevermind. This appears to be a bug in "ScreenResults"
only not Best Practical’s code.

Actually, this is maybe a bug in Mason? If I follow
the code chain:

 push @row, ProcessColumnMapValue ($attr,
                    Arguments => [ $Ticket, 0 ], Escape => 1);

ProcessColumnMapValue() is defined in lib/RT/Interface/Web.pm:

 ...
 return $m->interp->apply_escapes( $value, 'h' ) if $args{'Escape'};
 ...

So it appears apply_escapes() is leaving behind ‘
’ tags?

Has anyone else seen this?

Actually, this is maybe a bug in Mason? If I follow
the code chain:

push @row, ProcessColumnMapValue ($attr,
                   Arguments => [ $Ticket, 0 ], Escape => 1);

ProcessColumnMapValue() is defined in lib/RT/Interface/Web.pm:

...
return $m->interp->apply_escapes( $value, 'h' ) if $args{'Escape'};
...

So it appears apply_escapes() is leaving behind ‘
’ tags?

Has anyone else seen this?

apply_escapes just calls a filter on output. You can use built-in
mason filters or custom ones. RT happens to hook the h one to call
the EscapeUTF8 function in Web.pm, and you can look at what kind of
transform it does.

ProcessColumnMapValue is the method that’s used in outputting row data
in ticket listings too, so you can get a sense of where else that code
is run.

-kevin

Actually, this is maybe a bug in Mason? If I follow
the code chain:

push @row, ProcessColumnMapValue ($attr,
                   Arguments => [ $Ticket, 0 ], Escape => 1);

ProcessColumnMapValue() is defined in lib/RT/Interface/Web.pm:

...
return $m->interp->apply_escapes( $value, 'h' ) if $args{'Escape'};
...

So it appears apply_escapes() is leaving behind ‘
’ tags?

Has anyone else seen this?

apply_escapes just calls a filter on output. You can use built-in
mason filters or custom ones. RT happens to hook the h one to call
the EscapeUTF8 function in Web.pm, and you can look at what kind of
transform it does.

ProcessColumnMapValue is the method that’s used in outputting row data
in ticket listings too, so you can get a sense of where else that code
is run.

I forgot to mention that you’ll want to look carefully at the data
returned. Some CF data is returned flagged “don’t escape me” by being
a reference, so something you expect to be escaped may be protected
from escaping.

-kevin

Thanks Kevin.

It’s a bug in RT-Extension-SearchResult.XLS after all
(which we use as-is, and also dropped in place, modified,
as ScreenResult.tsv)

RT-Extension-SearchResult doesn’t loop over and comma-
separate multi-value CFs like stock “Results.tsv”

Bug report submitted with fix info:

https://rt.cpan.org/Public/Bug/Display.html?id=74824On 2/9/2012 5:58 PM, Kevin Falcone wrote:

On Thu, Feb 09, 2012 at 01:36:22PM -0500, Jeff Blaine wrote:

Actually, this is maybe a bug in Mason? If I follow
the code chain:

 push @row, ProcessColumnMapValue ($attr,
                    Arguments =>  [ $Ticket, 0 ], Escape =>  1);

ProcessColumnMapValue() is defined in lib/RT/Interface/Web.pm:

 ...
 return $m->interp->apply_escapes( $value, 'h' ) if $args{'Escape'};
 ...

So it appears apply_escapes() is leaving behind ‘
’ tags?

Has anyone else seen this?

apply_escapes just calls a filter on output. You can use built-in
mason filters or custom ones. RT happens to hook the h one to call
the EscapeUTF8 function in Web.pm, and you can look at what kind of
transform it does.

ProcessColumnMapValue is the method that’s used in outputting row data
in ticket listings too, so you can get a sense of where else that code
is run.

-kevin


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston — March 5& 6, 2012