Fixed: Bulk edit of issues throws 500 if no versions are defined on the project (#4366).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3140 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f2520385e4
commit
b090098952
|
@ -84,7 +84,7 @@ module ProjectsHelper
|
|||
if grouped.keys.size > 1
|
||||
grouped_options_for_select(grouped, selected && selected.id)
|
||||
else
|
||||
options_for_select(grouped.values.first, selected && selected.id)
|
||||
options_for_select((grouped.values.first || []), selected && selected.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -60,4 +60,9 @@ class ProjectsHelperTest < HelperTestCase
|
|||
def test_format_version_name_for_system_version
|
||||
assert_equal "OnlineStore - Systemwide visible version", format_version_name(Version.find(7))
|
||||
end
|
||||
|
||||
def test_version_options_for_select_with_no_versions
|
||||
assert_equal '', version_options_for_select([])
|
||||
assert_equal '<option value="1" selected="selected">0.1</option>', version_options_for_select([], Version.find(1))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue