[Rtir] ArticleTemplate

Ruslan Zakirov ruz at bestpractical.com
Wed Jan 12 06:56:42 EST 2011


Hello,

Sadly enough on create ticket object is not available on create as
there is no ticket at the moment. Your article templates should be
aware that ticket is not always available and use conditions.

On Wed, Jan 12, 2011 at 2:26 PM, Michal Wodzinski
<michal.wodzinski at uni-c.dk> wrote:
> On Tue, 4 Jan 2011, Michal Wodzinski wrote:
>
>> The "Reply to reporters" feature from an Incident is quite nice... But I
>> was wondering, is there any way for an RTFM Article (that uses
>> RTFM::ArticleTemplate), used in such a "multi"-reply, to include the report
>> ticket numbers instead of the incident ticket number?
>
> I solved this one (granted, a workaround...) by simply rephrasing the
> message to something like: see the subject field for the ticket number.
>
>
> But now I'm having another interesting challenge with regards to
> ArticleTemplates.
>
> RT::FM includes an option (RTFM_TicketCreate) to enable RTFM Article use on
> ticket create pages (especially useful when doing an investigate to from
> Lookup.html). This is really nice.
>
> But when Create.html uses an RTFM Article, it doesn't work with the
> RTFM::Extension::ArticleTemplates extension. It actually borks on
> ParseTemplate() not being able to reach $Ticket, which should be $TicketObj
> passed from Create.html. This isn't being passed on entirely as it should
> (or just not passed).
>
> I've been poking around in
>  - html/RTFM/Article/Elements/Preformatted
>  - html/Callbacks/RTFM/Ticket/Create.html/BeforeCreate
> in the RT::FM plugin directory, and
>  -
> html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent
> in the RTFM::Extension::ArticleTemplates plugin directory, and other places,
> but can't quite seem to get it right...
>
> Any ideas where to start to make it work?
>
>
> The error and call stack from an apache error log is:
> [Wed Jan 12 11:27:27 2011] [error]: Article parsing error: Can't call method
> "CustomFieldValues" on an undefined value at template line 6.
>
> Stack:
>  [template:6]
>  [/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:75]
>  [/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:19]
>  [/opt/rt3/share/html/Elements/Callback:52]
>  [/opt/rt3/local/plugins/RT-FM/html/RTFM/Article/Elements/Preformatted:112]
>  [/opt/rt3/local/plugins/RT-FM/html/Callbacks/RTFM/Elements/MessageBox/Default:78]
>  [/opt/rt3/share/html/Elements/MessageBox:49]
>  [/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:226]
>  [/opt/rt3/share/html/Widgets/TitleBox:51]
>  [/opt/rt3/local/plugins/RT-IR/html/RTIR/Create.html:249]
>  [/opt/rt3/bin/../lib/RT/Interface/Web.pm:320]
>  [/opt/rt3/bin/../lib/RT/Interface/Web.pm:224]
>  [/opt/rt3/share/html/autohandler:53]
> (/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/lib/RT/FM/Article_Local.pm:70)
> [Wed Jan 12 11:27:27 2011] [error]: Couldn't parse article's content:
> Article parsing error
> (/opt/rt3/local/plugins/RTFM-Extension-ArticleTemplates/html/Callbacks/RTFM-Extension-ArticleTemplates/RTFM/Article/Elements/Preformatted/ProcessContent:21)
>
> and the undefined value at template:6 is $Ticket->CustomFieldValues('IP');
> in this specific example. The RTFM Article (+ template code) works from
> Update.html.
>
> --
> Kind regards
> Michal Wodzinski, DK-CERT (UNI-C)
> 3587 8817 / 2483 2451
> PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)
> _______________________________________________
> Rtir mailing list
> Rtir at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rtir
>



-- 
Best regards, Ruslan.


More information about the Rtir mailing list