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
aa5f64e1
Commit
aa5f64e1
authored
9 years ago
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1261124: When deleting a component, this component is listed again
r/a=dkl
parent
97a24182
master
dev
release-5.0-stable
version-5.2
release-5.0.6-etersoft
release-5.0.5-etersoft
release-5.0.4-etersoft
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Component.pm
Bugzilla/Component.pm
+4
-1
No files found.
Bugzilla/Component.pm
View file @
aa5f64e1
...
@@ -148,7 +148,8 @@ sub remove_from_db {
...
@@ -148,7 +148,8 @@ sub remove_from_db {
$dbh
->
bz_start_transaction
();
$dbh
->
bz_start_transaction
();
# Products must have at least one component.
# Products must have at least one component.
if
(
scalar
(
@
{
$self
->
product
->
components
})
==
1
)
{
my
@components
=
@
{
$self
->
product
->
components
};
if
(
scalar
(
@components
)
==
1
)
{
ThrowUserError
(
'component_is_last'
,
{
comp
=>
$self
});
ThrowUserError
(
'component_is_last'
,
{
comp
=>
$self
});
}
}
...
@@ -165,6 +166,8 @@ sub remove_from_db {
...
@@ -165,6 +166,8 @@ sub remove_from_db {
ThrowUserError
(
'component_has_bugs'
,
{
nb
=>
$self
->
bug_count
});
ThrowUserError
(
'component_has_bugs'
,
{
nb
=>
$self
->
bug_count
});
}
}
}
}
# Update the list of components in the product object.
$self
->
product
->
{
components
}
=
[
grep
{
$_
->
id
!=
$self
->
id
}
@components
];
$self
->
SUPER::
remove_from_db
();
$self
->
SUPER::
remove_from_db
();
$dbh
->
bz_commit_transaction
();
$dbh
->
bz_commit_transaction
();
...
...
This diff is collapsed.
Click to expand it.
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