Skip to content

Commit 7fe7fdd

Browse files
committed
Roadmap tab is missing if there are only inherited from parent project versions (#34983).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20921 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent bd31345 commit 7fe7fdd

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

lib/redmine.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@
367367
:param => :project_id,
368368
:if =>
369369
Proc.new do |p|
370-
if Setting.display_subprojects_issues?
371-
p.rolled_up_versions.any?
370+
if p.shared_versions.any?
371+
true
372372
else
373-
p.shared_versions.any?
373+
Setting.display_subprojects_issues? && p.rolled_up_versions.any?
374374
end
375375
end
376376
)

test/integration/lib/redmine/menu_manager_test.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,21 @@ def test_project_menu_should_show_roadmap_if_subprojects_have_versions
147147
assert_select '#main-menu a.roadmap', 0
148148
end
149149
end
150+
151+
def test_project_menu_should_show_roadmap_if_project_has_shared_version
152+
Version.delete_all
153+
project = Project.generate!(:parent_id => 2)
154+
155+
Version.generate!(project_id: 2, sharing: 'tree')
156+
157+
with_settings :display_subprojects_issues => '1' do
158+
get "/projects/#{project.id}"
159+
assert_select '#main-menu a.roadmap'
160+
end
161+
162+
with_settings :display_subprojects_issues => '0' do
163+
get "/projects/#{project.id}"
164+
assert_select '#main-menu a.roadmap'
165+
end
166+
end
150167
end

0 commit comments

Comments
 (0)