Commit 06634b9b authored by jplang's avatar jplang

Fixed: Bulk edit of issues throws 500 if no versions are defined on the project (#4366).

git-svn-id: https://svn.redmine.org/redmine/trunk@3140 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 01a45fc3
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment