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
f2df808d
Commit
f2df808d
authored
Jun 03, 2006
by
lpsolit%gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 340116: Flag::FormToNewFlags() uses incorrect data - Patch by Frédéric…
Bug 340116: Flag::FormToNewFlags() uses incorrect data - Patch by Frédéric Buclin <LpSolit@gmail.com> r=kiko a=myk
parent
d60de25b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
+12
-17
Flag.pm
Bugzilla/Flag.pm
+2
-2
FlagType.pm
Bugzilla/FlagType.pm
+10
-15
No files found.
Bugzilla/Flag.pm
View file @
f2df808d
...
@@ -716,8 +716,8 @@ sub FormToNewFlags {
...
@@ -716,8 +716,8 @@ sub FormToNewFlags {
# Get a list of active flag types available for this target.
# Get a list of active flag types available for this target.
my
$flag_types
=
Bugzilla::FlagType::
match
(
my
$flag_types
=
Bugzilla::FlagType::
match
(
{
'target_type'
=>
$target
->
{
'type'
},
{
'target_type'
=>
$target
->
{
'type'
},
'product_id'
=>
$target
->
{
'product_id'
},
'product_id'
=>
$target
->
{
'
bug'
}
->
{
'
product_id'
},
'component_id'
=>
$target
->
{
'component_id'
},
'component_id'
=>
$target
->
{
'
bug'
}
->
{
'
component_id'
},
'is_active'
=>
1
});
'is_active'
=>
1
});
my
@flags
;
my
@flags
;
...
...
Bugzilla/FlagType.pm
View file @
f2df808d
...
@@ -528,26 +528,21 @@ sub sqlify_criteria {
...
@@ -528,26 +528,21 @@ sub sqlify_criteria {
# Add inclusions to the query, which simply involves joining the table
# Add inclusions to the query, which simply involves joining the table
# by flag type ID and target product/component.
# by flag type ID and target product/component.
push
(
@$tables
,
"INNER JOIN flaginclusions ON "
.
push
(
@$tables
,
"INNER JOIN flaginclusions AS i ON flagtypes.id = i.type_id"
);
"flagtypes.id = flaginclusions.type_id"
);
push
(
@criteria
,
"(i.product_id = $product_id OR i.product_id IS NULL)"
);
push
(
@criteria
,
"(flaginclusions.product_id = $product_id "
.
push
(
@criteria
,
"(i.component_id = $component_id OR i.component_id IS NULL)"
);
" OR flaginclusions.product_id IS NULL)"
);
push
(
@criteria
,
"(flaginclusions.component_id = $component_id "
.
" OR flaginclusions.component_id IS NULL)"
);
# Add exclusions to the query, which is more complicated. First of all,
# Add exclusions to the query, which is more complicated. First of all,
# we do a LEFT JOIN so we don't miss flag types with no exclusions.
# we do a LEFT JOIN so we don't miss flag types with no exclusions.
# Then, as with inclusions, we join on flag type ID and target product/
# Then, as with inclusions, we join on flag type ID and target product/
# component. However, since we want flag types that *aren't* on the
# component. However, since we want flag types that *aren't* on the
# exclusions list, we add a WHERE criteria to use only records with
# exclusions list, we add a WHERE criteria to use only records with
# NULL exclusion type, i.e. without any exclusions.
# NULL exclusion type, i.e. without any exclusions.
my
$join_clause
=
"flagtypes.id = flagexclusions.type_id "
.
my
$join_clause
=
"flagtypes.id = e.type_id "
.
"AND (flagexclusions.product_id = $product_id "
.
"AND (e.product_id = $product_id OR e.product_id IS NULL) "
.
"OR flagexclusions.product_id IS NULL) "
.
"AND (e.component_id = $component_id OR e.component_id IS NULL)"
;
"AND (flagexclusions.component_id = $component_id "
.
push
(
@$tables
,
"LEFT JOIN flagexclusions AS e ON ($join_clause)"
);
"OR flagexclusions.component_id IS NULL)"
;
push
(
@criteria
,
"e.type_id IS NULL"
);
push
(
@$tables
,
"LEFT JOIN flagexclusions ON ($join_clause)"
);
push
(
@criteria
,
"flagexclusions.type_id IS NULL"
);
}
}
if
(
$criteria
->
{
group
})
{
if
(
$criteria
->
{
group
})
{
my
$gid
=
$criteria
->
{
group
};
my
$gid
=
$criteria
->
{
group
};
...
...
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