From ff5a336ddbdc541f90d56c7fd871389c2fb2a4ee Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Wed, 21 Jan 2026 07:03:25 +0000 Subject: [PATCH] Fixes a bug where the link to subproject wiki page points to parent project (#43631). git-svn-id: https://svn.redmine.org/redmine/trunk@24336 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting/macros.rb | 2 +- test/unit/lib/redmine/wiki_formatting/macros_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index ec8775aae..cc4793a12 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -261,7 +261,7 @@ module Redmine pages.each do |page| concat( tag.li do - html = link_to(h(page.pretty_title), project_wiki_page_path(project, page.title)) + html = link_to(h(page.pretty_title), project_wiki_page_path(page.project, page.title)) html << " (#{time_ago_in_words(page.content.updated_on)})" if is_show_time html end diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 33e2a76dc..c471be4e8 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -668,7 +668,9 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest # With include_subprojects=true result = textilizable('{{recent_pages(include_subprojects=true)}}') + assert_select_in result, 'ul>li', :text => /Subproject Page/, :count => 1 + assert_select_in result, 'a[href=?]', wiki_page_path(page) end def test_recent_pages_macro_should_not_include_projects_with_wiki_module_disabled