Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

RT 4.0.5 bug in Excel export

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


bertignac at gmail

Apr 11, 2012, 1:41 AM

Post #1 of 13 (1576 views)
Permalink
RT 4.0.5 bug in Excel export

Hi,

Some HTML stuff is not handled properly, see attachment. It worked
well in RT 3.8.7

I don't know if it has been fixed in some branch but I experienced
the problem with the last Results.tsv available on github.

BR,
--
L.B.
Attachments: xlsexport.jpg (60.7 KB)


tjrc at sanger

Apr 11, 2012, 2:02 AM

Post #2 of 13 (1512 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On 11 Apr 2012, at 09:41, L B wrote:

> Hi,
>
> Some HTML stuff is not handled properly, see attachment. It worked
> well in RT 3.8.7
>
> I don't know if it has been fixed in some branch but I experienced
> the problem with the last Results.tsv available on github.

I saw a similar thing when using Status with a CustomStatus callback which colours my statuses (as in the example in the Wiki).

The problem in that case was that the callback was being called *after* the Excel export does its ScrubHTML bit, so HTML gets through. I had to alter my callback so that it checked if the request for a Results page.

This looks like a similar issue. Are you using any callbacks or extensions which change how the priorities are displayed in your web pages? If you are, that's probably the cause.

Tim

--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


bertignac at gmail

Apr 11, 2012, 2:25 AM

Post #3 of 13 (1511 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

>
> I saw a similar thing when using Status with a CustomStatus callback which colours my statuses (as in the example in the Wiki).
>
> The problem in that case was that the callback was being called *after* the Excel export does its ScrubHTML bit, so HTML gets through.  I had to alter my callback so that it checked if the request for a Results page.
>
> This looks like a similar issue.  Are you using any callbacks or extensions which change how the priorities are displayed in your web pages?  If you are, that's probably the cause.

Yes, I use http://search.cpan.org/dist/RT-Extension-PriorityAsString/ extension.

--
L.B.


tjrc at sanger

Apr 11, 2012, 5:35 AM

Post #4 of 13 (1523 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On 11 Apr 2012, at 10:25, L B wrote:

>>
>> I saw a similar thing when using Status with a CustomStatus callback which colours my statuses (as in the example in the Wiki).
>>
>> The problem in that case was that the callback was being called *after* the Excel export does its ScrubHTML bit, so HTML gets through. I had to alter my callback so that it checked if the request for a Results page.
>>
>> This looks like a similar issue. Are you using any callbacks or extensions which change how the priorities are displayed in your web pages? If you are, that's probably the cause.
>
> Yes, I use http://search.cpan.org/dist/RT-Extension-PriorityAsString/ extension.

Aha! The issue here is not a bug in RT 4.x at all, but merely a plugin which hasn't been updated for RT 4.

What you need to do is modify the callback in that extension (html/Callbacks/PriorityAsString/Elements/RT__Ticket/ColumnMap/Once) so that it doesn't do all that snazzy html when the request is for Results.tsv. Something like this might work [WARNING: Untested code!]:

<%ARGS>
$COLUMN_MAP => {}
</%ARGS>
<%INIT>
my $printer = sub {
my ($class, $string) = @_;
return '' unless defined $string && length $string;

my $request_path = $HTML::Mason::Commands::r->path_info;

if ($request_path =~ /Results\.tsv/) {
return \"$string";
}

my $escaped = $m->interp->apply_escapes($string, 'h');
my $loc_escaped = $m->interp->apply_escapes(loc($string), 'h');
return \( qq{<span class="ticket-info-$class-}. lc($escaped) .qq{">$loc_escaped</span>} );

};
foreach my $field (qw(Priority InitialPriority FinalPriority)) {
$COLUMN_MAP->{ $field .'Number' } ||= $COLUMN_MAP->{ $field };

my $class = lc($field);
$class =~ s/(?=<.)(?=priority)/-/;

my $method = $field .'AsString';

$COLUMN_MAP->{ $field }{'value'} = sub {
return $printer->( $class, $_[0]->$method() );
};
}
return;
</%INIT>

--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


bertignac at gmail

Apr 11, 2012, 7:03 AM

Post #5 of 13 (1513 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On Wed, Apr 11, 2012 at 2:35 PM, Tim Cutts <tjrc [at] sanger> wrote:
>
> On 11 Apr 2012, at 10:25, L B wrote:
>
>>>
>>> I saw a similar thing when using Status with a CustomStatus callback which colours my statuses (as in the example in the Wiki).
>>>
>>> The problem in that case was that the callback was being called *after* the Excel export does its ScrubHTML bit, so HTML gets through.  I had to alter my callback so that it checked if the request for a Results page.
>>>
>>> This looks like a similar issue.  Are you using any callbacks or extensions which change how the priorities are displayed in your web pages?  If you are, that's probably the cause.
>>
>> Yes, I use http://search.cpan.org/dist/RT-Extension-PriorityAsString/ extension.
>
> Aha!  The issue here is not a bug in RT 4.x at all, but merely a plugin which hasn't been updated for RT 4.
>

Thanks Tim for the investigation.

Hello Ruslan,

Do you plan to upgrade your extension or should I try this hack?

Thanks!
--
L.B.


falcone at bestpractical

Apr 11, 2012, 7:50 AM

Post #6 of 13 (1520 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On Wed, Apr 11, 2012 at 04:03:57PM +0200, L B wrote:
> On Wed, Apr 11, 2012 at 2:35 PM, Tim Cutts <tjrc [at] sanger> wrote:
> >
> > On 11 Apr 2012, at 10:25, L B wrote:
> >
> >>>
> >>> I saw a similar thing when using Status with a CustomStatus callback which colours my statuses (as in the example in the Wiki).
> >>>
> >>> The problem in that case was that the callback was being called *after* the Excel export does its ScrubHTML bit, so HTML gets through.  I had to alter my callback so that it checked if the request for a Results page.
> >>>
> >>> This looks like a similar issue.  Are you using any callbacks or extensions which change how the priorities are displayed in your web pages?  If you are, that's probably the cause.
> >>
> >> Yes, I use http://search.cpan.org/dist/RT-Extension-PriorityAsString/ extension.
> >
> > Aha!  The issue here is not a bug in RT 4.x at all, but merely a plugin which hasn't been updated for RT 4.
> >
>
> Thanks Tim for the investigation.
>
> Hello Ruslan,
>
> Do you plan to upgrade your extension or should I try this hack?

Please don't CC developers directly, lots of us work on the
extensions. It would be great if Tim filed his patch in the appropriate
rt.cpan.org queue.

-kevin


tjrc at sanger

Apr 11, 2012, 8:35 AM

Post #7 of 13 (1508 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On 11 Apr 2012, at 15:50, Kevin Falcone wrote:

> Please don't CC developers directly, lots of us work on the
> extensions. It would be great if Tim filed his patch in the appropriate
> rt.cpan.org queue.

I wasn't brave enough to do that. It's not an extension I use - I wrote that patched version direct in my email with code pasted from the CPAN code browser, so it really hasn't be tested at all. The ColumnMap examples in the Wiki have the same "bug". Given that all ColumnMap callbacks that worked in RT 3.8 will be affected by this, it could be considered a regression in 4.0 I suppose; the fundamental cause is that the callback happens in share/html/Elements/ColumnMap, which is called by share/html/Search/Results.tsv. Unfortunately, that callback happens *after* Results.tsv has cbballed the ScrubHTML code.

There might be more satisfactory and general solutions that could be implemented in the Results.tsv mason page. Rather simplistically, it could just run ScrubHTML across everything that comes out of the ColumnMap.

Tim

--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


falcone at bestpractical

Apr 11, 2012, 8:55 AM

Post #8 of 13 (1510 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On Wed, Apr 11, 2012 at 04:35:25PM +0100, Tim Cutts wrote:
>
> On 11 Apr 2012, at 15:50, Kevin Falcone wrote:
>
> > Please don't CC developers directly, lots of us work on the
> > extensions. It would be great if Tim filed his patch in the appropriate
> > rt.cpan.org queue.
>
> I wasn't brave enough to do that. It's not an extension I use - I
> wrote that patched version direct in my email with code pasted from
> the CPAN code browser, so it really hasn't be tested at all. The
> ColumnMap examples in the Wiki have the same "bug". Given that all
> ColumnMap callbacks that worked in RT 3.8 will be affected by this, it
> could be considered a regression in 4.0 I suppose; the fundamental
> cause is that the callback happens in share/html/Elements/ColumnMap,
> which is called by share/html/Search/Results.tsv. Unfortunately, that
> callback happens *after* Results.tsv has cbballed the ScrubHTML code.

>
> There might be more satisfactory and general solutions that could be
> implemented in the Results.tsv mason page. Rather simplistically, it
> could just run ScrubHTML across everything that comes out of the
> ColumnMap.

Yep, but it wants a bug somewhere (in RT for the possible regression)
or in the module pointing out the problem. Possibly both, with
pointers between them.

I appreciate you digging into it and checking it out.

-kevin


cloos at netsandbox

Apr 11, 2012, 2:39 PM

Post #9 of 13 (1488 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

Am 11.04.2012 17:35, schrieb Tim Cutts:
> There might be more satisfactory and general solutions that could be implemented in the Results.tsv mason page. Rather simplistically, it could just run ScrubHTML across everything that comes out of the ColumnMap.

Long time ago I send an patch for this but sadly it wasn't accepted
(Patch 2/2):
http://article.gmane.org/gmane.comp.bug-tracking.request-tracker.devel/6244

-Chris


falcone at bestpractical

Apr 11, 2012, 2:45 PM

Post #10 of 13 (1494 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On Wed, Apr 11, 2012 at 11:39:00PM +0200, Christian Loos wrote:
> Am 11.04.2012 17:35, schrieb Tim Cutts:
> > There might be more satisfactory and general solutions that could be implemented in the Results.tsv mason page. Rather simplistically, it could just run ScrubHTML across everything that comes out of the ColumnMap.
>
> Long time ago I send an patch for this but sadly it wasn't accepted
> (Patch 2/2):
> http://article.gmane.org/gmane.comp.bug-tracking.request-tracker.devel/6244

I don't think you replied to my reply:
http://article.gmane.org/gmane.comp.bug-tracking.request-tracker.devel/6256
or filed a bug with an updated patch with a commit message that
explained the problem.

-kevin


cloos at netsandbox

Apr 15, 2012, 10:45 PM

Post #11 of 13 (1446 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

Am 11.04.2012 23:45, schrieb Kevin Falcone:
> I don't think you replied to my reply:
> http://article.gmane.org/gmane.comp.bug-tracking.request-tracker.devel/6256
> or filed a bug with an updated patch with a commit message that
> explained the problem.

The patch already contains an commit message that explain the problem
and I don't know what I should describe more.

-Chris


falcone at bestpractical

Apr 17, 2012, 9:01 AM

Post #12 of 13 (1418 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

On Mon, Apr 16, 2012 at 07:45:04AM +0200, Christian Loos wrote:
> Am 11.04.2012 23:45, schrieb Kevin Falcone:
> >I don't think you replied to my reply:
> >http://article.gmane.org/gmane.comp.bug-tracking.request-tracker.devel/6256
> >or filed a bug with an updated patch with a commit message that
> >explained the problem.
>
> The patch already contains an commit message that explain the
> problem and I don't know what I should describe more.

If you believe your commit is complete, please submit it somewhere to
be applied. The bugtracker or a github pull request are much better
than the archives of rt-devel.

-kevin


bertignac at gmail

May 31, 2012, 8:32 AM

Post #13 of 13 (1303 views)
Permalink
Re: RT 4.0.5 bug in Excel export [In reply to]

FYI, the patch works as expected.

--
L.B.

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.