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
cdc776b3
Commit
cdc776b3
authored
Jan 30, 2011
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another bustage fix for bug 616185: in some cases, the columnlist parameter was…
Another bustage fix for bug 616185: in some cases, the columnlist parameter was appended to the list of bugs
parent
604ed541
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
DB.pm
Bugzilla/Install/DB.pm
+20
-8
No files found.
Bugzilla/Install/DB.pm
View file @
cdc776b3
...
@@ -3486,21 +3486,33 @@ sub _migrate_user_tags {
...
@@ -3486,21 +3486,33 @@ sub _migrate_user_tags {
# Tags are all lowercase.
# Tags are all lowercase.
my
$tag_name
=
lc
(
$name
);
my
$tag_name
=
lc
(
$name
);
$sth_tags
->
execute
(
$user_id
,
$tag_name
);
# Some queries were incorrectly parsed when _migrate_user_tags()
# was first implemented, and so some tags may have already been
# added to the DB. We don't want to crash in that case.
eval
{
$sth_tags
->
execute
(
$user_id
,
$tag_name
);
};
my
$tag_id
=
$dbh
->
selectrow_array
(
my
$tag_id
=
$dbh
->
selectrow_array
(
'SELECT id FROM tags WHERE user_id = ? AND name = ?'
,
'SELECT id FROM tags WHERE user_id = ? AND name = ?'
,
undef
,
(
$user_id
,
$tag_name
));
undef
,
(
$user_id
,
$tag_name
));
$query
=~
s/^bug_id=//
;
my
$columnlist
=
""
;
# Commas in Bugzilla 3.x are encoded as %2C, but not in 2.22.
if
(
$query
=~
/^bug_id=([^&;]+)(.*)$/
)
{
$query
=~
s/%2C/,/g
;
my
$buglist
=
$1
;
my
@bug_ids
=
split
(
/[\s,]+/
,
$query
);
$columnlist
=
$2
if
$2
;
$sth_bug_tag
->
execute
(
$_
,
$tag_id
)
foreach
@bug_ids
;
# Commas in Bugzilla 3.x are encoded as %2C, but not in 2.22.
$buglist
=~
s/%2C/,/g
;
my
@bug_ids
=
split
(
/[\s,]+/
,
$buglist
);
foreach
my
$bug_id
(
@bug_ids
)
{
# Some sanity check. We never know.
next
unless
detaint_natural
(
$bug_id
);
# For the same reason as above, let's do it in an eval.
eval
{
$sth_bug_tag
->
execute
(
$bug_id
,
$tag_id
);
};
}
}
# Existing tags may be used in whines, or shared with
# Existing tags may be used in whines, or shared with
# other users. So we convert them rather than delete them.
# other users. So we convert them rather than delete them.
my
$encoded_name
=
url_quote
(
$tag_name
);
my
$encoded_name
=
url_quote
(
$tag_name
);
$sth_nq
->
execute
(
"tag=$encoded_name"
,
$user_id
,
$name
);
$sth_nq
->
execute
(
"tag=$encoded_name
$columnlist
"
,
$user_id
,
$name
);
}
}
$dbh
->
bz_drop_column
(
'namedqueries'
,
'query_type'
);
$dbh
->
bz_drop_column
(
'namedqueries'
,
'query_type'
);
...
...
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