Search for attachment content failing

When I do a search of attachments in 2-1-75 it returns no
results…(except the first time I tried for some reason)…and the
apache error log says:

[warning]: DBIx::SearchBuilder error:Unknown table ‘Attachments_2’ in
where clause
Query String is SELECT count(DISTINCT main.id) FROM Tickets main WHERE
((main.EffectiveId = main.id)) AND ((main.Type = ‘ticket’)) AND ( ( (
(Attachments_2.Content LIKE ‘%groupwise%’) ) ) ) AND
Attachments_2.TransactionId = Transactions_1.id AND main.id =
Transactions_1.Ticket LIMIT 25
(/opt/rt3/lib/RT.pm:220)

I can’t find where the table names are set. Can anyone point me in the
right direction?

Shawn Crosby
MIS - JWA

Shawn Crosby wrote:

When I do a search of attachments in 2-1-75 it returns no
results…(except the first time I tried for some reason)…and the
apache error log says:

Shawn-

Please provide a little more information as to _how_ you did a
search of attachments?  What field did you enter data in?

-R

In /Search/Listing.html in the ‘Ticket Attachment’ Search criteria with
‘Content’ and ‘Matches’ selected, if I type in a keyword, it will work
once, but if I refine the search at all…say add a queue
Restriction…it returns 0 results (even though there are many), and all
subsequent searches fail until I remove the Attachment search
restriction. If I close the browser window…ie start a new session, I
can perform the search again, but the same result follows.

S.

Robert Spier 02/23/03 04:40AM >>>
Shawn Crosby wrote:
When I do a search of attachments in 2-1-75 it returns no
results…(except the first time I tried for some reason)…and the
apache error log says:

Shawn-

Please provide a little more information as to how you did a
search of attachments? What field did you enter data in?

-R

OK…it seems that in Tickets_Overlay.pm in sub _TransLimit, there is a
line that defines an alias for the transaction and attachments tables
but only if they aren’t already defined. Seems like they are ‘defined’
no matter what. I got rid of the ‘unless’ part and it seems to work
pretty good now:

From
$sb->{_sql_transalias} = $sb->NewAlias (‘Transactions’)
unless defined $sb->{_sql_transalias};
$sb->{_sql_trattachalias} = $sb->NewAlias (‘Attachments’)
unless defined $sb->{_sql_trattachalias};
To
$sb->{_sql_transalias} = $sb->NewAlias (‘Transactions’);
$sb->{_sql_trattachalias} = $sb->NewAlias (‘Attachments’);

Does anyone see any potential problems with this?

S.

Robert Spier 02/23/03 04:40AM >>>
Shawn Crosby wrote:
When I do a search of attachments in 2-1-75 it returns no
results…(except the first time I tried for some reason)…and the
apache error log says:

Shawn-

Please provide a little more information as to how you did a
search of attachments? What field did you enter data in?

-R

Shawn,

Please try this patch:

— Tickets_Overlay_SQL.pm Fri Feb 21 22:37:05 2003
+++ /pkg/rt3/lib/RT/Tickets_Overlay_SQL.pm Mon Feb 24 19:59:04 2003
@@ -290,6 +290,7 @@
my ($self,$query) = @_;

$self->CleanSlate;

  • $self->_InitSQL();

    return unless $query;

-R

Shawn Crosby wrote: