[Rt-commit] r13116 - rt/branches/3.8-TESTING/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Tue Jun 10 14:17:24 EDT 2008
Author: ruz
Date: Tue Jun 10 14:17:21 2008
New Revision: 13116
Modified:
rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm
Log:
* if column is defined it's wrong to involve LargeContent
Modified: rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm Tue Jun 10 14:17:21 2008
@@ -1294,37 +1294,52 @@
$self->_OpenParen;
$self->_OpenParen;
+ # if column is defined then deal only with it
+ # otherwise search in Content and in LargeContent
+ if ( $column ) {
+ $self->_SQLLimit(
+ ALIAS => $TicketCFs,
+ FIELD => $column,
+ OPERATOR => $op,
+ VALUE => $value,
+ %rest
+ );
+ }
+ else {
+ $self->_SQLLimit(
+ ALIAS => $TicketCFs,
+ FIELD => 'Content',
+ OPERATOR => $op,
+ VALUE => $value,
+ %rest
+ );
- $self->_SQLLimit(
- ALIAS => $TicketCFs,
- FIELD => $column || 'Content',
- OPERATOR => $op,
- VALUE => $value,
- %rest
- );
-
- $self->_OpenParen;
-
- $self->_SQLLimit(
- ALIAS => $TicketCFs,
- FIELD => $column || 'Content',
- OPERATOR => '=',
- VALUE => '',
- QUOTEVALUE => 1,
- ENTRYAGGREGATOR => 'OR'
- );
-
- $self->_SQLLimit(
- ALIAS => $TicketCFs,
- FIELD => 'LargeContent',
- OPERATOR => $op,
- VALUE => $value,
- QUOTEVALUE => 1,
- ENTRYAGGREGATOR => 'AND',
- );
-
- $self->_CloseParen;
-
+ $self->_OpenParen;
+ $self->_OpenParen;
+ $self->_SQLLimit(
+ ALIAS => $TicketCFs,
+ FIELD => 'Content',
+ OPERATOR => '=',
+ VALUE => '',
+ ENTRYAGGREGATOR => 'OR'
+ );
+ $self->_SQLLimit(
+ ALIAS => $TicketCFs,
+ FIELD => 'Content',
+ OPERATOR => 'IS',
+ VALUE => 'NULL',
+ ENTRYAGGREGATOR => 'OR'
+ );
+ $self->_CloseParen;
+ $self->_SQLLimit(
+ ALIAS => $TicketCFs,
+ FIELD => 'LargeContent',
+ OPERATOR => $op,
+ VALUE => $value,
+ ENTRYAGGREGATOR => 'AND',
+ );
+ $self->_CloseParen;
+ }
$self->_CloseParen;
# XXX: if we join via CustomFields table then
More information about the Rt-commit
mailing list