Defect #34025

Issue subject truncated to 100 chars in the list from Projects > View all issues > Atom

Added by Iker Mendiola 8 months ago. Updated 4 months ago.

Status:ConfirmedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Feeds
Target version:-
Resolution: Affected version:

Description

The atom feed from a Project does not truncate the subjects, but using the link for All Projects does it.
Even using redmine.org > Projects > View all issues > Atom, issue 33965 is truncated:

    <title>Redmine - Defect #33965 (New): REST API: Method Not Available see used Status list as per the tra...</title>
    <link rel="alternate" href="https://www.redmine.org/issues/33965"/>

History

#1 Updated by Iker Mendiola 8 months ago

In fact, all atom feeds (not only for all project, but aslo por an individual project) are truncating issue subject to 100 chars.
Example in Redmine project:

    <title>Defect #33953 (Confirmed): Repository Tab will not showing if no repository is set as "Main repos...</title>
    <link rel="alternate" href="https://www.redmine.org/issues/33953"/>

The probelm with "all projects" is that it adds the Project's name as prefix, so it is easier to truncate the value
Regards

#2 Updated by Go MAEDA 8 months ago

  • Category set to Feeds

I agree that 100 chars is too short because the maximum length of Issue#title can be 255 chars. So, at least 255 chars of titles are handled without truncation.

Atom feeds are added in r670 in 2007. At that time, Redmine already trimmed down the title to 100 chars.

#3 Updated by Iker Mendiola 7 months ago

Also take into account that generating the atom from All Projects > View all issues, it adds the project's name as prefix in the title field, so it will have more characters....

#4 Updated by Go MAEDA 5 months ago

Go MAEDA wrote:

I agree that 100 chars is too short because the maximum length of Issue#title can be 255 chars. So, at least 255 chars of titles are handled without truncation.

The following patch changes the length limit of the title to 300. Since the maximum length of Issue#title is 255 chars, I think 300 is enough for most cases.

diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builder
index 0fbe1063c..c151cf99a 100644
--- a/app/views/common/feed.atom.builder
+++ b/app/views/common/feed.atom.builder
@@ -4,7 +4,7 @@ protocol = Setting.protocol
 host = Setting.host_name
 xml.instruct!
 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
-  xml.title truncate_single_line_raw(@title, 100)
+  xml.title truncate_single_line_raw(@title, 300)
   xml.link(
     "rel" => "self",
     "href" =>
@@ -37,9 +37,9 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
     xml.entry do
       url = url_for(item.event_url(:only_path => false, :protocol => protocol, :host => host))
       if @project == item.project
-        xml.title truncate_single_line_raw(item.event_title, 100)
+        xml.title truncate_single_line_raw(item.event_title, 300)
       else
-        xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 100)
+        xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 300)
       end
       xml.link "rel" => "alternate", "href" => url
       xml.id URL

#5 Updated by Go MAEDA 4 months ago

  • Status changed from New to Confirmed

#6 Updated by Marius BALTEANU 4 months ago

Why truncate to 300 if the column length is 255?

Maybe it's better to not truncate anymore.

#7 Updated by Go MAEDA 4 months ago

Marius BALTEANU wrote:

Why truncate to 300 if the column length is 255?

Although the maximum length of a subject is 255, a feed title includes additional information such as tracker name and project name.

Maybe it's better to not truncate anymore.

I agree. The max length of a project name and a tracker name is 255 and 30, so I don't think there is any problem without truncate.

Also available in: Atom PDF