[rt-users] URL Error after upgrading to rt4

Rolf Krogstad rgk at pacelabs.com
Tue Feb 19 17:04:35 EST 2013

Kevin Falcone <falcone <at> bestpractical.com> writes:

> On Thu, Feb 14, 2013 at 10:29:30PM +0000, Rolf Krogstad wrote:
> > Hello,
> > 
> > I have created a new server (RedHat 5.9 64-bit) and am running the latest 
> > version of MySQL and RT 4.0.10.   The old server was RT 3.6.6
> There were some bugs in early 3.6 RTs where it would store the full
> URL so /rt3/Ticket/Display.html?id=__id__ rather than 
> /__WebPath__/Ticket/Display.html?id=__id__
> > With one user I can go in and select a ticket and it opens fine with the 
> > http://v20labtrack/Ticket/Display.html?id=2973
> > 
> > If I log in as a different user it generates this URL which comes up with 
> > a "page not found" error:
> > http://v20labtrack/rt3/Ticket/Display.html?id=2973
> This implies some users have a version of the Format for the search
> that includes __WebPath__ and some include /rt3/ literally.
> There's a new branch that adds an upgrade script

> You can grab that script and try running it on a development copy of
> your data and see if it properly repairs the links for you.
> Try it out and let us know how it goes?  The branch needs review and
> merging, but test results from the field are really helpful.
> -kevin

Thanks, Kevin.   Not being a perl expert I need some assistance.
I managed to get my library path inserted but have one syntax to correct.
I insert as line #2
use lib "/opt/rt4/lib/RT;
I then deleted an empty line from the comment section so the code lines line 
up with your example.

I am getting this back on the compile:
syntax error at ./fix-3.6-search-result-format-in-attribute.pl line 66, 
near "&& $content->{Format} =~ s!(?<=href=")"
  (Might be a runaway multi-line "" string starting on line 2)

My URL is generating (for example):
and I want it to be:  

so I changed this line to rt3:    
    my $path = shift @ARGV || 'rt3';

how do I need to change this one?
    && $content->{Format} =~ s!(?<=href=")/$path(?=/|$)!__WebPath__!ig )

thanks   Rolf

More information about the rt-users mailing list