プロジェクト

全般

プロフィール

Vote #81283

完了

Activity tab in cross-project menu is sometimes broken

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
152
issue_org_id:
34805
author_id:
3866
assigned_to_id:
332
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

When navigating to a page for a global object the "Activity" tab in the tab menu might link to @/projects/:id/activity@ with the ID of the object instead of @/activity@. This is the wrong link and the link might be broken.

For example, when editing an issue query that is for all projects with the ID 123, the URL of the page is @/queries/123/edit@. In that case the "Activity" tab will implicitly use the ID of the query to construct the activity link and the "Activity" tab will link to @/projects/123/activity@. As the query is a query for all projects the tabs shown are for the @:application_menu@ and the link should be to the global activity and not the specific activity of a project. Furthermore, a project with that ID might not exist so this might lead to an error page.

I hope this explanation was clear, if there is any doubt feel free to ask for a clarification.


journals

The following patch (also attached) fixes the issue and adds a test:

<pre><code class="diff">
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 2d4dd0f7d..142b60888 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -225,7 +225,7 @@ Redmine::MenuManager.map :application_menu do |menu|
menu.push :projects, {:controller => 'projects', :action => 'index'},
:permission => nil,
:caption => :label_project_plural
- menu.push :activity, {:controller => 'activities', :action => 'index'}
+ menu.push :activity, {:controller => 'activities', :action => 'index', :id => nil}
menu.push(
:issues,
{:controller => 'issues', :action => 'index'},
diff --git a/test/integration/lib/redmine/menu_manager_test.rb b/test/integration/lib/redmine/menu_manager_test.rb
index 07fbcc332..318bc6129 100644
--- a/test/integration/lib/redmine/menu_manager_test.rb
+++ b/test/integration/lib/redmine/menu_manager_test.rb
@@ -126,6 +126,12 @@ class MenuManagerTest < Redmine::IntegrationTest
end
end

+ def test_cross_project_menu_should_link_to_global_activity
+ log_user('dlopper', 'foo')
+ get '/queries/3/edit'
+ assert_select 'a.activity[href=?]', '/activity'
+ end
+
def test_project_menu_should_show_roadmap_if_subprojects_have_versions
Version.delete_all
# Create a version in the project "eCookbook Subproject 1"
</code></pre>
--------------------------------------------------------------------------------
Setting the target version to 4.1.2.
--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0