Re: [rt-users] RT 4.0.5 bug in Excel export

2012-05-31 Thread L B
FYI, the patch works as expected.

-- 
L.B.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-17 Thread Kevin Falcone
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


pgpsZvCxSBHmK.pgp
Description: PGP signature


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Tim Cutts

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.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread L B

 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.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Tim Cutts

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.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread L B
On Wed, Apr 11, 2012 at 2:35 PM, Tim Cutts t...@sanger.ac.uk 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.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Kevin Falcone
On Wed, Apr 11, 2012 at 04:03:57PM +0200, L B wrote:
 On Wed, Apr 11, 2012 at 2:35 PM, Tim Cutts t...@sanger.ac.uk 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


pgpvLBSFApwek.pgp
Description: PGP signature


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Tim Cutts

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.


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Kevin Falcone
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


pgpO8oG7PC7tT.pgp
Description: PGP signature


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Christian Loos
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


Re: [rt-users] RT 4.0.5 bug in Excel export

2012-04-11 Thread Kevin Falcone
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


pgpY4z2oc2H6q.pgp
Description: PGP signature