[Rt-devel] logic bug on caching queues

Ruslan Zakirov ruz at bestpractical.com
Thu Jul 5 11:04:59 EDT 2007

On 7/5/07, Nicholas Clark <nick at ccl4.org> wrote:
> I note that RT::Queue::StatusArray() is documented as
>   Returns an array of all statuses for this queue
> Whilst the current implementation does not return different results per
> queue, the facility seems to be there to do it.
> However /html/Elements/SelectStatus has
>     <%ONCE>
>     my $queue = new RT::Queue($session{'CurrentUser'});
>     my @status = $queue->StatusArray();
>     </%ONCE>
> Am I right in my understanding of Mason that that ONCE block is run exactly
> once at the time of loading the page? If so, surely it will cache the status
> list to early, and hence prevent a correct drop down if someone wishes to
> customise RT to have different statuses available on different queues.
I agree with Jesse that we should move into this direction, but note
that even if you'll change this part you'll face another problem. In
the query builder we need list of all statuses we have in the select
box. Loading all queues and going through them is not a variant, so we
need new methods or adjust current methods. I see two variants:
1) Add new methods AllStatusArray and other .*Status.*  methods with All prefix.
2) adjust methods we have, so they should return/validate all statuses
if the object is not loaded (!$self->id).

I like the second one and think it'll help us to get rid of the State

> Nicholas Clark
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Best regards, Ruslan.

More information about the Rt-devel mailing list