In a comment of a revision: No link to issue

Added by Super User about 5 years ago

Hello,

We mark that a revision belongs to an issue using this syntax in the comment of our commits: "CR#<id>:" (much like with "refs #<id>")
Redmine doesn't recognize this by default (the space between <keywords> and #<id> is mandatory), so I modified app/models/changeset.rb so it recognizes this.
Indeed, under an Issue, I can see all the revisions that reference the Issue with CR#<id>. However, in the comment of the revision, the text CR#<id> is not a link, whereas refs #<id> is.
Attached is a screenshot so you can see what I mean (it's pretty simple).
So, I am looking for the code which inserts the link to the issue in the comment.

Thanks a lot!
SuperUser

Replies (2)

RE: In a comment of a revision: No link to issue - Added by William Roush about 5 years ago

I'm 99% sure that using the standard "#(number)" it's triggered by the "textilizable" method called on pages.

https://bitbucket.org/redmine/redmine-all/src/b2b0c60e7351/app/helpers/application_helper.rb#cl-508

Which calls "parse_redmine_links"

https://bitbucket.org/redmine/redmine-all/src/b2b0c60e7351/app/helpers/application_helper.rb#cl-683

You'll have to add the "CR#" to the regex and the separator below.

RE: In a comment of a revision: No link to issue - Added by Super User about 5 years ago

William, thanks a lot!
Thanks to your help, I was able to make the changes in less than half an hour. Do you think there is any sense in providing a (slightly more abstract) patch so that people who are using similar syntax than us can benefit from it, too? (like Issue#4 or so ...)

(1-2/2)