Same goes for the tokens in Project Release (there we just went around it).

The idea of Project Activity is that the Project is the center of attention and that every Release or Issue created belongs to a certain Project. This is why we make the Project the center of attention (the node to which the activity belongs) in each logged action.

As Releases and Issues are also nodes (with custom tokens) they kind of get left-out from the token_replace_multiple() function call. Token bases its replacements on an associative array with each key being the internal 'type' and each value being the object, then it just goes around asking other modules to specify token values for these types.

We always pass the Project as the main 'node' type (by design in Activity and Token) and are unable to pass any additional 'node' types. Releases and Issues are therefor passed as 'project_release' and 'project_issue' types.

Possible solutions

  • Make adjustments to Activity (change how objects are handled, allow more objects of the same type) or Project (next to the node type, also accept the 'project_release' and 'project_issue' types).
  • OR (my preferred way): Activity allows defining specific 'activity' tokens; all tokens not belonging to a Project (but rather a release or an issue) will be in a seperate category 'Project Activity' and be defined in this project.
  • The last solution is I think the preferred way; it will however create duplication of tokens.

Comments

sirkitree’s picture

It seems this comes down to the relationship between projects and their issues and releases then.

I think creating an activity template for issues, and creating them for releases, should not be a problem. But then having that message record the fact that it is related to a project is where the problem is. Correct?

So the process for creating a view that would show all of the activity for a project, would be to first compile a list of the project's related nodes (issues/releases) and show any activity messages for those nodes. Sounds rather intense. I'll think on this some more...

cvangysel’s picture

Well, I've gotten as far as recording messages for Issues and Releases and then linking in the the Project node. But it's just that Token support obviously isn't going to work as the Node type we pass to Tokens will always be the Project node.

I've already created a view for all activity for a project, and it works as expected ... only the default tokens aren't replaced by their respective values.

cvangysel’s picture

Assigned: Unassigned » cvangysel
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.