Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
609806d1
Commit
609806d1
authored
Jul 07, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 577089: Make convert-workflow fix the query values for series
r=LpSolit, a=LpSolit
parent
ab04fe6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
Saved.pm
Bugzilla/Search/Saved.pm
+5
-2
Series.pm
Bugzilla/Series.pm
+5
-0
convert-workflow.pl
contrib/convert-workflow.pl
+2
-0
No files found.
Bugzilla/Search/Saved.pm
View file @
609806d1
...
...
@@ -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 i
d = ?"
,
$dbh
->
do
(
"UPDATE
$table SET query = ? WHERE $id_fiel
d = ?"
,
undef
,
$query
,
$id
);
}
...
...
Bugzilla/Series.pm
View file @
609806d1
...
...
@@ -34,6 +34,11 @@ package Bugzilla::Series;
use
Bugzilla::
Error
;
use
Bugzilla::
Util
;
# This is a hack so that we can re-use the rename_field_value
# code from Bugzilla::Search::Saved.
use
constant
DB_TABLE
=>
'series'
;
use
constant
ID_FIELD
=>
'series_id'
;
sub
new
{
my
$invocant
=
shift
;
my
$class
=
ref
(
$invocant
)
||
$invocant
;
...
...
contrib/convert-workflow.pl
View file @
609806d1
...
...
@@ -102,6 +102,8 @@ foreach my $pair (@translation) {
}
Bugzilla::Search::
Saved
->
rename_field_value
(
'bug_status'
,
$from
,
$to
);
Bugzilla::
Series
->
Bugzilla::Search::Saved::
rename_field_value
(
'bug_status'
,
$from
,
$to
);
}
$dbh
->
bz_commit_transaction
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment