Project

General

Profile

Actions

Defect #43526

open

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

Added by Mizuki ISHIKAWA 22 days ago. Updated about 8 hours ago.

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

0%

Estimated time:
Resolution:
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 about 12 hours 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 about 8 hours ago

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

Actions

Also available in: Atom PDF