Unable to create scrips in RT 4.2.12

Good afternoon,
I recently inherited a RT installation. After upgrading our test system to 4.2.12 I am unable to create scrips, either locally or for a specific queue. I get a standard “An internal error has occurred” message from the web UI, and the following in syslog:

[17510] Can’t call method “Queue” on an undefined value at /opt/rt4/sbin/…/lib/RT/Scrip.pm line 450.#012#012Stack:#012 [/opt/rt4/sbin/…/lib/RT/Scrip.pm:450]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:83]#012
[/opt/rt4/share/html/Widgets/TitleBox:56]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:89]#012
[/opt/rt4/share/html/Admin/Queues/Scrip.html:52]#012
[/opt/rt4/share/html/Admin/autohandler:49]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:681]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:369]#012
[/opt/rt4/share/html/autohandler:53]#012

I have verified that the undefined value is $args{‘TicketObj’} in the Stage function in Scrip.pm, but haven’t gotten any further. I’ll be greatful for any suggestions.

The previous admin had made some customizations to the Tabs file. It looks like some internal URL plumbing changed between 4.0.9 and 4.2.12, and the URLs specified in the menu pointed to bad locations.From: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of David Ramage
Sent: Monday, November 09, 2015 3:54 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Unable to create scrips in RT 4.2.12

Good afternoon,
I recently inherited a RT installation. After upgrading our test system to 4.2.12 I am unable to create scrips, either locally or for a specific queue. I get a standard “An internal error has occurred” message from the web UI, and the following in syslog:

[17510] Can’t call method “Queue” on an undefined value at /opt/rt4/sbin/…/lib/RT/Scrip.pm line 450.#012#012Stack:#012 [/opt/rt4/sbin/…/lib/RT/Scrip.pm:450]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:83]#012
[/opt/rt4/share/html/Widgets/TitleBox:56]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:89]#012
[/opt/rt4/share/html/Admin/Queues/Scrip.html:52]#012
[/opt/rt4/share/html/Admin/autohandler:49]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:681]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:369]#012
[/opt/rt4/share/html/autohandler:53]#012

I have verified that the undefined value is $args{‘TicketObj’} in the Stage function in Scrip.pm, but haven’t gotten any further. I’ll be greatful for any suggestions.

Good catch!

I’m sure other people have better ways to do this, but this is what works for me in our environment:

First I copy the original RT file into the local/ directory tree (per standard RT modification practices).
But I make two copies there - one is named with a “.orig” file extension.
e.g.
Tabs
Tabs.orig

The .orig file is a copy of the original Tabs file (at the time I modified it, lets say version 4.0.9.
After I run an upgrade (e,g, to 4.2.12), I first do a ‘diff’ on the Tabs.orig (remember, that is 4.0.9) against the new Tabs (4.2.12).
If the files are the same (no changes in the new version of RT), I keep my changed Tabs file as-is.
If there are changes in the new rev, I must manually merge my changes into it.
(and then copy the new version (original) as the new Tabs.orig, ready for the next upgrade).

A nice side effect of this is that I can run a ‘find’ command after each upgrade for *.orig, to ensure I am merging all code changes.

Just my 2 cents.

  •      BrentFrom: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of David Ramage
    

Sent: Tuesday, November 10, 2015 6:42 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Unable to create scrips in RT 4.2.12

The previous admin had made some customizations to the Tabs file. It looks like some internal URL plumbing changed between 4.0.9 and 4.2.12, and the URLs specified in the menu pointed to bad locations.

From: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of David Ramage
Sent: Monday, November 09, 2015 3:54 PM
To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: [rt-users] Unable to create scrips in RT 4.2.12

Good afternoon,
I recently inherited a RT installation. After upgrading our test system to 4.2.12 I am unable to create scrips, either locally or for a specific queue. I get a standard “An internal error has occurred” message from the web UI, and the following in syslog:

[17510] Can’t call method “Queue” on an undefined value at /opt/rt4/sbin/…/lib/RT/Scrip.pm line 450.#012#012Stack:#012 [/opt/rt4/sbin/…/lib/RT/Scrip.pm:450]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:83]#012
[/opt/rt4/share/html/Widgets/TitleBox:56]#012
[/opt/rt4/share/html/Admin/Elements/EditScrip:89]#012
[/opt/rt4/share/html/Admin/Queues/Scrip.html:52]#012
[/opt/rt4/share/html/Admin/autohandler:49]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:681]#012
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:369]#012
[/opt/rt4/share/html/autohandler:53]#012

I have verified that the undefined value is $args{‘TicketObj’} in the Stage function in Scrip.pm, but haven’t gotten any further. I’ll be greatful for any suggestions.

Hi Brent,

you should give Callbacks [1] a chance.
We use this for years. Minor (4.2.11 > 4.2.12) version updates are done
without any modification. Sometimes even major (4.2.12 > 4.4.0) updates
can be make without changing a callback file.

Chris

[1]
Writing extensions - RT 4.2.17 Documentation - Best Practical 11.11.2015 um 03:53 schrieb Parish, Brent:

Good catch!

I�m sure other people have better ways to do this, but this is what
works for me in our environment:

First I copy the original RT file into the local/ directory tree (per
standard RT modification practices).

But I make two copies there � one is named with a �.orig� file extension.

e.g.

Tabs

 Tabs.orig

The .orig file is a copy of the original Tabs file (at the time I
modified it, lets say version 4.0.9.

After I run an upgrade (e,g, to 4.2.12), I first do a �diff� on the
Tabs.orig (remember, that is 4.0.9) against the new Tabs (4.2.12).

If the files are the same (no changes in the new version of RT), I keep
my changed Tabs file as-is.

If there are changes in the new rev, I must manually merge my changes
into it.

(and then copy the new version (original) as the new Tabs.orig, ready
for the next upgrade).

A nice side effect of this is that I can run a �find� command after each
upgrade for *.orig, to ensure I am merging all code changes.

Just my 2 cents.

  •      Brent
    

Awesome idea – thanks, Chris!From: Christian Loos [mailto:cloos@netcologne.de]
Sent: Wednesday, November 11, 2015 1:33 AM
To: Parish, Brent; David Ramage; rt-users@lists.bestpractical.com
Subject: Re: Unable to create scrips in RT 4.2.12

Hi Brent,

you should give Callbacks [1] a chance.
We use this for years. Minor (4.2.11 > 4.2.12) version updates are done without any modification. Sometimes even major (4.2.12 > 4.4.0) updates can be make without changing a callback file.

Chris

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.bestpractical.com_docs_rt_4.2_writing-5Fextensions.html-23Callbacks&d=CwID-g&c=VCWpAYkS3z1bOCIxc-BPGZarCq9MRCAVxZJE051VqH8&r=luSRdPePk6fhFa3rH2PFBzWEtgcJguY0a__6vpfaX-I&m=McuUaLqBVdmZULlQOCtTdy-4eKG1SF68GCtyYZn8kEU&s=_59KjpgZJcA4mJMDI7cIiDyOEDdhVc2aaiW-8M8CwmA&e=