Project

General

Profile

Actions

Defect #43526

closed

When using the include macro in the project description, an execution error occurs in the project list (list view)

Added by Mizuki ISHIKAWA about 1 month ago. Updated 12 days ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When the include macro is used in a project’s description, it renders correctly on the project overview and the project list in board view, but it fails with an error in the project list in list view.

Steps to reproduce:
  • Add {{include(WikiPageName)}} to the project description.
    • Open the project overview page – the macro is rendered correctly.
    • Open the project list (board view) – the macro is rendered correctly.
    • Open the project list (list view) – the macro fails to render and the following error is shown instead of the description. Error executing the include macro (Page not found)

Possible cause:
In the project list list view, @project is not set when rendering the project description. Because of that, the include macro cannot determine which project’s wiki page it should load, and it results in a “Page not found” error.
When the project is explicitly specified, such as {{include(projectname:WikiPageName)}}, the macro works correctly in all views, including the project list list view.


Files

Actions #1

Updated by Mizuki ISHIKAWA 23 days ago

I am attaching a patch to fix this issue.
In this patch, the macros no longer rely solely on @project. Instead, the project is resolved in the following order:
  • @project (as before)
  • the object itself, if it is a Project
  • obj.project, if the object responds to it (e.g. issue.project)

With this change, {{include(WikiPageName)}} works consistently in all views, including the project list list view. The same fix has also been applied to the recent_pages macro, which had the same underlying issue.

Additionally, in ProjectsHelper, the rendering of short_description has been changed to use textilizable(project, :short_description, ...), so that the project object is explicitly passed to the macro instead of relying on @project.

Actions #2

Updated by Florian Walchshofer 23 days ago

I recommended this patch, which also resolved the issue addressed by the other patch.
#43372

Actions #3

Updated by Marius BĂLTEANU 16 days ago

  • Assignee set to Marius BĂLTEANU
  • Target version set to Candidate for next minor release
Actions #4

Updated by Marius BĂLTEANU 16 days ago

Go MAEDA, do you see any problem in we deliver this fix in minor versions?

Actions #5

Updated by Go MAEDA 16 days ago

Marius BĂLTEANU wrote in #note-4:

Go MAEDA, do you see any problem in we deliver this fix in minor versions?

I think this fix can be included in the next minor release since it does not change existing behavior.

Actions #6

Updated by Marius BĂLTEANU 12 days ago

  • Status changed from New to Resolved
  • Target version changed from Candidate for next minor release to 6.0.8
  • Resolution set to Fixed

Patch committed, thanks!

Actions #7

Updated by Marius BĂLTEANU 12 days ago

  • Status changed from Resolved to Closed
  • Target version changed from 6.0.8 to 6.1.1

Merged only to 6.1-stable branch, on 6.0 there are conflicts. Please let me know if we should back port this to 6.0 also.

Actions

Also available in: Atom PDF