Project

General

Profile

Actions

Defect #44623

closed

Wiki include() macro adds faulty "Edit this section"-links

Added by Lennart Kindermann 21 days ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
Resolution:
Fixed
Affected version:

Description

Summary

Starting with Redmine 7, included sections (via the include() macro) on wiki pages are now displaying the "Edit this section"-link, which are generated after resolving the macros and therefore pointing to the wrong edit page.

On Redmine 6.0.7 the links were not rendered.

On Redmine 7.0.2 the links are generated and as the sections are counting up, the links become unusable, starting with the first included section, see attached screenshots.

Steps to reproduce

Wiki Page 1

# Test Wiki

## Some local heading

Local text

{{include(test2:TEST2)}}

## More local heading

More local text

Wiki Page 2 (included in page 1)

# Included Heading 1

## Included Heading 2 

Included text

Environment

Environment:
  Redmine version                7.0.2.stable
  Ruby version                   4.0.7-p0 (2026-09-15) [x86_64-linux]
  Rails version                  8.1.4
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Subversion                     1.14.5
  Mercurial                      7.0.1
  Bazaar                         3.3.11
  Git                            2.47.3
  Filesystem                     
Redmine plugins:
  no plugin installed

Files

Screenshot_20261015_150453.png (44.9 KB) Screenshot_20261015_150453.png Redmine 7.0.2 Lennart Kindermann, 2026-10-15 15:25
Screenshot_20261015_150528.png (30.5 KB) Screenshot_20261015_150528.png Redmine 7.0.2 - Click on 2 Lennart Kindermann, 2026-10-15 15:25
Screenshot_20261015_150514.png (11.7 KB) Screenshot_20261015_150514.png Redmine 7.0.2 - Click on 3 or 4 Lennart Kindermann, 2026-10-15 15:25
Screenshot_20261015_150114.png (34.5 KB) Screenshot_20261015_150114.png Redmine 6.0.7 Lennart Kindermann, 2026-10-15 15:25
0001-fix.patch (8.7 KB) 0001-fix.patch Marius BĂLTEANU, 2026-10-21 22:21

Related issues

Related to Redmine - Defect #44164: Edit link is missing or incorrect in Wiki pages with the collapse macroClosedActions
Actions #1

Updated by Go MAEDA 17 days ago

  • Status changed from New to Confirmed
  • Affected version changed from 7.0.2 to 7.0.0
Actions #2

Updated by Go MAEDA 17 days ago

  • Related to Defect #44164: Edit link is missing or incorrect in Wiki pages with the collapse macro added
Actions #3

Updated by Marius BĂLTEANU 15 days ago

The attached patch fixes this by hiding the output of macros while section edit links are parsed, then putting it back before the headings are parsed. Included headings keep their anchors and TOC entries, but they no longer get edit links.

In theory, the change should not break any plugin because the new :sections param is false by default.

Actions #4

Updated by Marius BĂLTEANU 8 days ago

  • Status changed from Confirmed to Resolved
  • Resolution set to Fixed

Committed the fix.

Actions #5

Updated by Marius BĂLTEANU 8 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF