RT error on method "Content"

I stuck in the OnQueueChange scrip this morning, and have been having some
difficulties with it. I’ve seen this problem before, but not quite so
often as what the OnQueueChange scrip is producing:

Program fragment at line 11 delivered error ``Can’t call method “Content"
on an undefined value”

There is actual message content, and it is recorded in the Attachments table.

System specifics:

perl: 5.6.1
RT: 2.0.6
scrip: OnQueueChange NotifyAdminCcs with template QueueChanged

template contents:

RT-Queue: {$Ticket->QueueObj->Name}
given)"}

{$Transaction->CreatedAsString}: Ticket #{$Ticket->id} changed to a queue
you are responsible for.

Requestors: {$Ticket->Requestors->EmailsAsString()}
Queue: {$Ticket->QueueObj->Name}
Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
{$Transaction->Attachments(‘text/plain’)->First->Content() ||
$Transaction->Attachments(‘text/html’)->First->Content() || “(No Viewable
Message.)”}

Anyone seen this? Know what it is? I’m assuming the offending line is the
final one in the script – since it does call the method Content(). And I
modeled it very close to the Transaction template.

p.s. I just checked the config, and it had been changed from OnQueueChange
to OnResolve…

This is why the transaction object now has a Content method.

your custom template isn’t checking to make sure that the transaction has
an attachment before attempting to operate on it.On Mon, Sep 10, 2001 at 04:12:02PM -0400, Damian Gerow wrote:

I stuck in the OnQueueChange scrip this morning, and have been having some
difficulties with it. I’ve seen this problem before, but not quite so
often as what the OnQueueChange scrip is producing:

Program fragment at line 11 delivered error ``Can’t call method “Content"
on an undefined value”

There is actual message content, and it is recorded in the Attachments table.

System specifics:

perl: 5.6.1
RT: 2.0.6
scrip: OnQueueChange NotifyAdminCcs with template QueueChanged

template contents:

RT-Queue: {$Ticket->QueueObj->Name}
Subject: [{$Ticket->QueueObj->Name}] {$Transaction->Subject || “(No subject
given)”}

{$Transaction->CreatedAsString}: Ticket #{$Ticket->id} changed to a queue
you are responsible for.

Requestors: {$Ticket->Requestors->EmailsAsString()}
Queue: {$Ticket->QueueObj->Name}
Subject: {$Transaction->Subject || “(No subject given)”}
Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}

{$Transaction->Attachments(‘text/plain’)->First->Content() ||
$Transaction->Attachments(‘text/html’)->First->Content() || “(No Viewable
Message.)”}

Anyone seen this? Know what it is? I’m assuming the offending line is the
final one in the script – since it does call the method Content(). And I
modeled it very close to the Transaction template.

p.s. I just checked the config, and it had been changed from OnQueueChange
to OnResolve…


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

At 04:19 PM 9/10/2001 -0400, Jesse Vincent wrote:

This is why the transaction object now has a Content method.

your custom template isn’t checking to make sure that the transaction has
an attachment before attempting to operate on it.

The problem with Transaction->Content() is that some messages then return
blank. I s’pose it’s better than an error, though.

I’ll have to actually write something in the template to check for the
attachment, and decide on that.

The problem with Transaction->Content() is that some messages then return
blank. I s’pose it’s better than an error, though.

Is it returning blank content any time that your custom template wouldn’t?
As of 2.0.6, that logic should be pretty good.

-j

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

The problem with Transaction->Content() is that some messages then return
blank. I s’pose it’s better than an error, though.

Is it returning blank content any time that your custom template wouldn’t?
As of 2.0.6, that logic should be pretty good.

I think the problem right now is that the OnQueueChange scripaction doesn’t
pass any message body, which is what’s causing the scrip to die with the
previous template. I haven’t played with the Transaction->Content() in
2.0.6, I guess I’ll give it a go today.

Thanks.