get the text value, then transform
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Apr 2008 17:07:25 +0000 (17:07 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 2 Apr 2008 17:07:25 +0000 (17:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9192 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm

index c12bab9..f5307ef 100644 (file)
@@ -949,12 +949,14 @@ sub toSQL {
                $sql .= " NOT BETWEEN ". join(" AND ", map { $_->toSQL } @$val);
        } elsif (lc($op) eq 'like') {
                $val = $$val[0] if (ref($val) eq 'ARRAY');
                $sql .= " NOT BETWEEN ". join(" AND ", map { $_->toSQL } @$val);
        } elsif (lc($op) eq 'like') {
                $val = $$val[0] if (ref($val) eq 'ARRAY');
+               $val = $val->toSQL;
                $val =~ s/^'(.*)'$/$1/o;
                $val =~ s/%/\\\\%/o;
                $val =~ s/_/\\\\_/o;
                $sql .= " LIKE '\%$val\%'";
        } elsif (lc($op) eq 'ilike') {
                $val = $$val[0] if (ref($val) eq 'ARRAY');
                $val =~ s/^'(.*)'$/$1/o;
                $val =~ s/%/\\\\%/o;
                $val =~ s/_/\\\\_/o;
                $sql .= " LIKE '\%$val\%'";
        } elsif (lc($op) eq 'ilike') {
                $val = $$val[0] if (ref($val) eq 'ARRAY');
+               $val = $val->toSQL;
                $val =~ s/^'(.*)'$/$1/o;
                $val =~ s/%/\\\\%/o;
                $val =~ s/_/\\\\_/o;
                $val =~ s/^'(.*)'$/$1/o;
                $val =~ s/%/\\\\%/o;
                $val =~ s/_/\\\\_/o;