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
ef925d69
Commit
ef925d69
authored
Feb 24, 2014
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 975896: Bugzilla crashes when editing a flag type which is not specifically requestable
r/a=glob
parent
97cd64da
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
Attachment.pm
Bugzilla/Attachment.pm
+4
-4
Classification.pm
Bugzilla/Classification.pm
+8
-7
FlagType.pm
Bugzilla/FlagType.pm
+8
-5
No files found.
Bugzilla/Attachment.pm
View file @
ef925d69
...
...
@@ -935,10 +935,10 @@ sub remove_from_db {
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
my
@flag_ids
=
$dbh
->
selectrow_array
(
my
$flag_ids
=
$dbh
->
selectcol_arrayref
(
'SELECT id FROM flags WHERE attach_id = ?'
,
undef
,
$self
->
id
);
$dbh
->
do
(
'DELETE FROM flags WHERE '
.
$dbh
->
sql_in
(
'id'
,
\
@
flag_ids
))
if
@flag_ids
;
$dbh
->
do
(
'DELETE FROM flags WHERE '
.
$dbh
->
sql_in
(
'id'
,
$
flag_ids
))
if
@
$
flag_ids
;
$dbh
->
do
(
'DELETE FROM attach_data WHERE id = ?'
,
undef
,
$self
->
id
);
$dbh
->
do
(
'UPDATE attachments SET mimetype = ?, ispatch = ?, isobsolete = ?
WHERE attach_id = ?'
,
undef
,
(
'text/plain'
,
0
,
1
,
$self
->
id
));
...
...
@@ -952,7 +952,7 @@ sub remove_from_db {
# As we don't call SUPER->remove_from_db we need to manually clear
# memcached here.
Bugzilla
->
memcached
->
clear
({
table
=>
'attachments'
,
id
=>
$self
->
id
});
foreach
my
$flag_id
(
@flag_ids
)
{
foreach
my
$flag_id
(
@
$
flag_ids
)
{
Bugzilla
->
memcached
->
clear
({
table
=>
'flags'
,
id
=>
$flag_id
});
}
}
...
...
Bugzilla/Classification.pm
View file @
ef925d69
...
...
@@ -48,6 +48,7 @@ use constant VALIDATORS => {
###############################
#### Constructors #####
###############################
sub
remove_from_db
{
my
$self
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
...
...
@@ -57,13 +58,13 @@ sub remove_from_db {
$dbh
->
bz_start_transaction
();
# Reclassify products to the default classification, if needed.
my
@product_ids
=
$dbh
->
selectrow_array
(
"SELECT id FROM products WHERE classification_id = ?"
,
undef
,
$self
->
id
);
if
(
@product_ids
)
{
$dbh
->
do
(
"UPDATE products SET classification_id = 1 WHERE "
.
$dbh
->
sql_in
(
'id'
,
\
@
product_ids
));
foreach
my
$id
(
@product_ids
)
{
my
$product_ids
=
$dbh
->
selectcol_arrayref
(
'SELECT id FROM products WHERE classification_id = ?'
,
undef
,
$self
->
id
);
if
(
@
$
product_ids
)
{
$dbh
->
do
(
'UPDATE products SET classification_id = 1 WHERE '
.
$dbh
->
sql_in
(
'id'
,
$
product_ids
));
foreach
my
$id
(
@
$
product_ids
)
{
Bugzilla
->
memcached
->
clear
({
table
=>
'products'
,
id
=>
$id
});
}
}
...
...
Bugzilla/FlagType.pm
View file @
ef925d69
...
...
@@ -185,14 +185,17 @@ sub update {
# Silently remove requestees from flags which are no longer
# specifically requestable.
if
(
!
$self
->
is_requesteeble
)
{
my
@ids
=
$dbh
->
selectrow_array
(
"SELECT id FROM flags WHERE type_id = ?"
,
undef
,
$self
->
id
);
$dbh
->
do
(
"UPDATE flags SET requestee_id = NULL WHERE "
.
$dbh
->
sql_in
(
'type_id'
,
\
@ids
));
foreach
my
$id
(
@ids
)
{
my
$ids
=
$dbh
->
selectcol_arrayref
(
'SELECT id FROM flags WHERE type_id = ? AND requestee_id IS NOT NULL'
,
undef
,
$self
->
id
);
if
(
@$ids
)
{
$dbh
->
do
(
'UPDATE flags SET requestee_id = NULL WHERE '
.
$dbh
->
sql_in
(
'id'
,
$ids
));
foreach
my
$id
(
@$ids
)
{
Bugzilla
->
memcached
->
clear
({
table
=>
'flags'
,
id
=>
$id
});
}
}
}
$dbh
->
bz_commit_transaction
();
return
$changes
;
...
...
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