Project

General

Profile

Actions

Defect #3483

closed

Relative url for source links in notifications

Added by William Baum over 15 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Email notifications
Target version:
Start date:
2009-06-12
Due date:
% Done:

80%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The email of an issue that includes a "source:" link is included in the email as a relative link ala:

<a href="/repositories/entry/..." class="source">source:...</a>

The link needs to be made absolute.

Not sure if this applies to other links besides source: links..

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 1.3.1
Rails version 2.1.2


Files

source_export-only_path.patch (895 Bytes) source_export-only_path.patch William Baum, 2009-10-19 06:25

Related issues

Related to Redmine - Feature #4052: Cross-project redmine links with alternate link text for source and export links.New2009-10-19

Actions
Actions #1

Updated by William Baum about 15 years ago

This issue should be resolved with the attached patch.

The link_to for source: and export: links wasn't setting :only_path => only_path, so the links weren't being converted to absolute links in emails, etc..

Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb    (revision 2879)
+++ app/helpers/application_helper.rb    (working copy)
@@ -527,7 +527,7 @@
             if project && project.repository
               name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
               path, rev, anchor = $1, $3, $5
-              link = link_to h("#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
+              link = link_to h("#{prefix}:#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'entry', :id => project,
                                                       :path => to_path_param(path),
                                                       :rev => rev,
                                                       :anchor => anchor,

Please also see Feature #4052 for additional enhancements to source and export links, as well as enhancements to commit, and revision links from #3346.

--Bill

Actions #2

Updated by Daniel Felix almost 12 years ago

I tested it with this comment. I was able to reproduce it. I get a mail with some invalid link. This should be corrected.

Actions #3

Updated by Daniel Felix almost 12 years ago

  • Status changed from New to Confirmed
  • Priority changed from Low to Normal
  • Affected version (unused) changed from 0.8.4 to 2.2.1
  • Affected version changed from 0.8.4 to 2.2.1
Actions #4

Updated by Etienne Massip almost 12 years ago

  • Target version set to Candidate for next minor release
Actions #5

Updated by Toshi MARUYAMA over 10 years ago

  • Related to Feature #4052: Cross-project redmine links with alternate link text for source and export links. added
Actions #6

Updated by Jean-Philippe Lang over 10 years ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next minor release to 2.5.2
  • Resolution set to Fixed

Patch applied in r13219, thanks.

Actions #7

Updated by Jean-Philippe Lang over 10 years ago

  • Status changed from Resolved to Closed

Merged.

Actions #8

Updated by Jean-Philippe Lang over 10 years ago

  • Subject changed from Relative rather than absolute href links in issue emails... to Relative url for source links in notifications
Actions

Also available in: Atom PDF