[Catalyst-commits] r8398 -
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Thu Sep 11 06:22:46 BST 2008
Author: karpet
Date: 2008-09-11 06:22:45 +0100 (Thu, 11 Sep 2008)
New Revision: 8398
Modified:
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm
Log:
normalize op compare
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm 2008-09-11 04:53:24 UTC (rev 8397)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/lib/CatalystX/CRUD/ModelAdapter/DBIC.pm 2008-09-11 05:22:45 UTC (rev 8398)
@@ -223,10 +223,12 @@
=cut
sub make_query {
- my $self = shift;
- my $controller = shift;
- my $c = shift;
- my $field_names = shift
+ my $self = shift;
+ my $controller = shift;
+ my $c = shift;
+ my $field_names
+ = shift
+ || $c->req->params->{'cxc-query-fields'}
|| $self->_get_field_names( $controller, $c );
my $query = $self->make_sql_query( $controller, $c, $field_names ) || {};
@@ -277,10 +279,10 @@
#carp "make_sql_query : " . dump $q;
if ( defined $q->{query}->[0] ) {
- if ( $q->{query}->[0] eq 'or' ) {
+ if ( uc( $q->{query}->[0] ) eq 'OR' ) {
$q->{query}->[0] = '-or';
}
- elsif ( $q->{query}->[0] eq 'and' ) {
+ elsif ( uc( $q->{query}->[0] ) eq 'AND' ) {
$q->{query}->[0] = '-and';
}
}
More information about the Catalyst-commits
mailing list