Defect #5939

Atom entry URL doesn't contain port

Added by Kirill Vasiliev over 12 years ago. Updated over 12 years ago.

Status:ClosedStart date:2010-07-22
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Cant reproduce Affected version:


Host name in settings set to <ip-address>:3000, but all ATOM entries has URLs without ports.
It works if I change code as follows:

Index: app/views/common/feed.atom.rxml
--- app/views/common/feed.atom.rxml     (revision 3810)
+++ app/views/common/feed.atom.rxml     (working copy)
@@ -1,4 +1,7 @@
+server_port = 3000
 xml.feed "xmlns" => "" do
   xml.title   truncate_single_line(@title, :length => 100)    "rel" => "self", "href" => url_for(params.merge(:only_path => false))
@@ -9,7 +12,7 @@
   xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
   @items.each do |item|
     xml.entry do
-      url = url_for(item.event_url(:only_path => false))
+      url = url_for(item.event_url(:only_path => false, :port => server_port))
       if @project
         xml.title truncate_single_line(item.event_title, :length => 100)

ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
Rails 2.3.5
Redmine 0.9.4.stable.3810 (SQLite)


#1 Updated by Felix Schäfer over 12 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

The host name setting is only used for the links in mails. The ATOM feed links are generated like every other link in redmine from the URL you are accessing it. The proposed patch also hard-codes the port, which is not desired behavior.

#2 Updated by Kirill Vasiliev over 12 years ago

  • Status changed from Closed to Reopened

It wasn't proposed patch, it was merely workaround demonstration. I'm sorry if I confuse you.

Some steps to reproduce:

  1. Install and run redmine on port 3000
  2. Create new project
  3. Go to the News tab
  4. Create new news article
  5. Hover on Atom link. The IP address will be http://&lt;address&gt;:3000/projects/&lt;project&gt;/news.atom?key=&lt;key>
  6. Click an Atom link and view the source of the feed generated. There will be entry like this:
        <link href="http://<address>/news/2" rel="alternate"/>
        <content type="html">

    Note the URLs inside href attribute and id element doesn't contain port.

#3 Updated by Jean-Philippe Lang over 12 years ago

  • Category set to Feeds
  • Status changed from Reopened to Closed
  • Resolution changed from Invalid to Cant reproduce

Here is what I get with latest trunk. You can see the port number in URLs:

    <title>foo - Feature #4481 (New): Issue A1</title>
    <link href="" rel="alternate"/>
      <name>Jean-Philippe Lang</name>
    <content type="html">

Also available in: Atom PDF