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
804be6b3
Commit
804be6b3
authored
Jan 17, 2013
by
Dave Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 752946 - Moving a bug into another product lists inactive components, milestones and versions
r/a=LpSolit
parent
13d265b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
Bug.pm
Bugzilla/Bug.pm
+21
-7
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+5
-0
No files found.
Bugzilla/Bug.pm
View file @
804be6b3
...
...
@@ -1446,8 +1446,13 @@ sub _check_component {
$name
||
ThrowUserError
(
"require_component"
);
my
$product
=
blessed
(
$invocant
)
?
$invocant
->
product_obj
:
$params
->
{
product
};
my
$obj
=
Bugzilla::
Component
->
check
({
product
=>
$product
,
name
=>
$name
});
return
$obj
;
my
$old_comp
=
blessed
(
$invocant
)
?
$invocant
->
component
:
$params
->
{
component
};
my
$object
=
Bugzilla::
Component
->
check
({
product
=>
$product
,
name
=>
$name
});
if
(
$object
->
name
ne
$old_comp
&&
!
$object
->
is_active
)
{
ThrowUserError
(
'value_inactive'
,
{
class
=>
ref
(
$object
),
value
=>
$name
});
}
return
$object
;
}
sub
_check_creation_ts
{
...
...
@@ -1905,10 +1910,15 @@ sub _check_target_milestone {
my
(
$invocant
,
$target
,
undef
,
$params
)
=
@_
;
my
$product
=
blessed
(
$invocant
)
?
$invocant
->
product_obj
:
$params
->
{
product
};
my
$old_target
=
blessed
(
$invocant
)
?
$invocant
->
target_milestone
:
$params
->
{
target_milestone
};
$target
=
trim
(
$target
);
$target
=
$product
->
default_milestone
if
!
defined
$target
;
my
$object
=
Bugzilla::
Milestone
->
check
(
{
product
=>
$product
,
name
=>
$target
});
if
(
$object
->
name
ne
$old_target
&&
!
$object
->
is_active
)
{
ThrowUserError
(
'value_inactive'
,
{
class
=>
ref
(
$object
),
value
=>
$target
});
}
return
$object
->
name
;
}
...
...
@@ -1931,8 +1941,12 @@ sub _check_version {
$version
=
trim
(
$version
);
my
$product
=
blessed
(
$invocant
)
?
$invocant
->
product_obj
:
$params
->
{
product
};
my
$object
=
Bugzilla::
Version
->
check
({
product
=>
$product
,
name
=>
$version
});
my
$old_vers
=
blessed
(
$invocant
)
?
$invocant
->
version
:
$params
->
{
version
};
my
$object
=
Bugzilla::
Version
->
check
({
product
=>
$product
,
name
=>
$version
});
if
(
$object
->
name
ne
$old_vers
&&
!
$object
->
is_active
)
{
ThrowUserError
(
'value_inactive'
,
{
class
=>
ref
(
$object
),
value
=>
$version
});
}
return
$object
->
name
;
}
...
...
@@ -2482,9 +2496,9 @@ sub _set_product {
milestone
=>
$milestone_ok
?
$self
->
target_milestone
:
$product
->
default_milestone
};
$vars
{
components
}
=
[
map
{
$_
->
name
}
@
{
$product
->
components
}
];
$vars
{
milestones
}
=
[
map
{
$_
->
name
}
@
{
$product
->
milestones
}
];
$vars
{
versions
}
=
[
map
{
$_
->
name
}
@
{
$product
->
versions
}
];
$vars
{
components
}
=
[
map
{
$_
->
name
}
grep
(
$_
->
is_active
,
@
{
$product
->
components
})
];
$vars
{
milestones
}
=
[
map
{
$_
->
name
}
grep
(
$_
->
is_active
,
@
{
$product
->
milestones
})
];
$vars
{
versions
}
=
[
map
{
$_
->
name
}
grep
(
$_
->
is_active
,
@
{
$product
->
versions
})
];
}
if
(
!
$verified
)
{
...
...
template/en/default/global/user-error.html.tmpl
View file @
804be6b3
...
...
@@ -1722,6 +1722,11 @@
[% title = "Unknown Tab" %]
<code>[% current_tab_name FILTER html %]</code> is not a legal tab name.
[% ELSIF error == "value_inactive" %]
[% title = "Value is Not Active" %]
[% type = BLOCK %][% INCLUDE object_name class = class %][% END %]
The [% type FILTER html %] value '[% value FILTER html %]' is not active.
[% ELSIF error == "version_already_exists" %]
[% title = "Version Already Exists" %]
[% admindocslinks = {'versions.html' => 'Administering versions'} %]
...
...
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