Project

General

Profile

Actions

Defect #42545

open

Commit message in issue history might be rendered in incorrect context

Added by Felix Schäfer 9 days ago. Updated 6 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

The commit messages of changesets associated with an issues are always rendered in the context of that issue in the issue's history view. This might not be the correct context if cross-project relations between issues and changesets are allowed and the changeset comes from a repository associated to another project.

For example if a commit message references a wiki page, the rendered wiki page link in the issue history will reference the wiki page of the issue's project instead of the wiki page of the repository's project.


Files

42545-20250408114000.patch (2.11 KB) 42545-20250408114000.patch Felix Schäfer, 2025-04-08 11:42
Actions #1

Updated by Felix Schäfer 9 days ago

The issue is because the textilizable method will use @project as the context if available. In the case of format_changeset_comments this might not always be the correct project context. Forcing the project to be the changeset's project solves this issue.

The attached patch solves the issue and adds a test. In the test the issue's project does not have the wiki module enabled and the issue history will not replace [[wiki]] with a link to a wiki page but will render the string [[wiki]] as is. With the fix this link is rendered correctly and links to the repository's project wiki page. Please note that the textilizable method checks the current user's permissions before rendering links, the change should not introduce security concerns.

Actions #2

Updated by Go MAEDA 6 days ago

  • Tracker changed from Patch to Defect
  • Category changed from UI to Text formatting
  • Status changed from New to Confirmed
  • Target version set to 5.1.8

Setting the target version to 5.1.8.

Actions

Also available in: Atom PDF