aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-07 17:17:26 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-07 17:17:26 -0700
commit609806d1f0e8a82300a6d7b3b47e09f0356217f5 (patch)
treeb5e9e020ae7e9d4ddf2e246336ecbf80850db3cb /Bugzilla/Search
parentab04fe6c61b5fd55ca4b838ccb7abfd542bd2128 (diff)
downloadbugs-609806d1f0e8a82300a6d7b3b47e09f0356217f5.tar
bugs-609806d1f0e8a82300a6d7b3b47e09f0356217f5.tar.gz
bugs-609806d1f0e8a82300a6d7b3b47e09f0356217f5.tar.bz2
bugs-609806d1f0e8a82300a6d7b3b47e09f0356217f5.tar.xz
bugs-609806d1f0e8a82300a6d7b3b47e09f0356217f5.zip
Bug 577089: Make convert-workflow fix the query values for series
r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/Search')
-rw-r--r--Bugzilla/Search/Saved.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm
index 32a24eae1..4b46fc75c 100644
--- a/Bugzilla/Search/Saved.pm
+++ b/Bugzilla/Search/Saved.pm
@@ -182,11 +182,14 @@ sub rename_field_value {
my $old_sql = $old;
$old_sql =~ s/([_\%])/\\$1/g;
+ my $table = $class->DB_TABLE;
+ my $id_field = $class->ID_FIELD;
+
my $dbh = Bugzilla->dbh;
$dbh->bz_start_transaction();
my %queries = @{ $dbh->selectcol_arrayref(
- "SELECT id, query FROM namedqueries WHERE query LIKE ?",
+ "SELECT $id_field, query FROM $table WHERE query LIKE ?",
{Columns=>[1,2]}, "\%$old_sql\%") };
foreach my $id (keys %queries) {
my $query = $queries{$id};
@@ -198,7 +201,7 @@ sub rename_field_value {
# boolean charts. Users will have to fix those themselves.
$query =~ s/\bvalue\Q$chart_id\E=\Q$old\E\b/value$chart_id=$new/i;
}
- $dbh->do("UPDATE namedqueries SET query = ? WHERE id = ?",
+ $dbh->do("UPDATE $table SET query = ? WHERE $id_field = ?",
undef, $query, $id);
}