[rt-users] Using Ajax with Mason in RT

Thomas Sibley trs at bestpractical.com
Thu Aug 16 12:48:06 EDT 2012


On 08/16/2012 02:22 AM, Martin Drasar wrote:
> This is my component:
> 
>> % $r->content_type('application/json');
>> <% JSON( \@something ) |n %>
>> % $m->abort();
>>
>> <%init>
>> my @something;
>> push (@something, 'something');
>> </%init>
>>
>> <%flags>
>> inherit => undef;
>> </%flags>
> 
> The problem is, when I remove the flags section, the ajax call fails
> with 403.

403 is Forbidden.  RT denies direct requests to /Elements/ directories
(among other internal components).  This denial happens in RT's normal
request handling phase, which doesn't get called when you set inherit =>
undef.

Please just remove the <%flags> section all together.  You also lose
things like encoding handling, not to mention authentication, when you
disable RT's request handling.

> If I keep it, I get back following error: "syntax error at
> /home/RT/RT-4.0.6/local/html/Ticket/Elements/TestComponent line 15, at EOF"

I'm betting it's the semicolon in the <%flags> section.  Remove it.  The
line number being off is Mason getting it wrong (I'll bet it's the line
# of the Mason object file).




More information about the rt-users mailing list