[Rt-devel] BUG in ParseQuery ?

Rolf Grossmann rg at progtech.net
Tue Nov 15 12:11:41 EST 2005


Todd Chapman wrote:

> On Wed, Nov 09, 2005 at 03:34:44PM -0500, Jesse Vincent wrote:
>>On Wed, Nov 09, 2005 at 04:01:28PM -0500, Todd Chapman wrote:
>>
>>>In Search/Build.html is sub ref ParseQuery with
>>>these lines:
>>>
>>>    my $string  = shift;
>>>    my $tree    = shift;
>>>    my @actions = shift;
>>>    my $want    = KEYWORD | PAREN;
>>>    my $last    = undef;
>>>
>>>Shouldn't @actions be $actions, a ref to an array?
>>>The sub goes on to push value onto the arrary but
>>>the new values won't be seen outside the sub.
>>>
>>>If I am correct, it is easy to fix, but then shows
>>>shows a deeper bug in the sub.
>>
>>That looks like a bug. assuming it's being called with an arrayref
> 
> Yes, it is. I tried changing it to: my $actions = shift
> 
> and changing all the "push @actions ..." to "push @$actions ..."
> 
> but then the sub breaks really bad. If you add a custom field
> to the query and then do anything that causes parse to run
> you get sent to the Advanced page to fix the not really
> broken query. Ugly. :)

Ok, I've now also had time to look at this. I don't think the breakage
is that bad. All you really need to do is teach the parser about CFs.
Here's a suggestion for a patch. I'm not quite sure if I hit the
preferred way to test for a custom field, but it seems to work for me.

Let me know what you think and whether I should file a bug report.

Rolf.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: search.patch
Type: text/x-patch
Size: 2177 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20051115/96462663/search.bin


More information about the Rt-devel mailing list