Defect #33829
openFix Atom feed for issues to correctly use the updated time for "updated" element instead of the created time
0%
Description
There are updated tags in the Atom of issues list.
However, the created on is exported.
I have attached a patch to fix this.
Files
Updated by Tatsuya Saito over 4 years ago
This issue is reported in following Japanese forum.
https://groups.google.com/forum/#!topic/redmine-users-ja/wb78I8uVJEY
Updated by Tatsuya Saito over 4 years ago
I'm sorry, patch.diff breaks Redmine rake test.
It breaks activity view items.
Please reject the patch.
Updated by Tatsuya Saito over 4 years ago
- File patch_trunk_r19958_pt1.diff patch_trunk_r19958_pt1.diff added
- File patch_trunk_r19958_pt2.diff patch_trunk_r19958_pt2.diff added
I think this problem only affects the atom of issues list.
There are updated tags created by issue.event_datetime.
But issue.event_datetime is created_on.
I think you need to use updated_on for the atom of issue list.
I re-create the patches for this issue.
In the first pattern, issue_controller overwrites issue.event_datetime between atom exports.
The second pattern, application_controller.rb and common/feed.atom.builder, adds the code for the problem list atom.
Both work, but I don't think it's clean code.
I'll attach both patches in the hope that it will help you think about better code.
Updated by Go MAEDA almost 4 years ago
- Target version set to Candidate for next major release
Updated by Go MAEDA 11 months ago
- File 33829-v3.patch 33829-v3.patch added
We can fix this issue by simply adding one line.
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 670921eb0..408ab485b 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -48,6 +48,7 @@ class Issue < ApplicationRecord
:scope => lambda {|options| options[:open_issues] ? self.open : self.all}
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
+ :datetime => Proc.new {|o| o.updated_on},
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
:type => Proc.new {|o| 'issue' + (o.closed? ? '-closed' : '')}
Updated by Go MAEDA 11 months ago
- Subject changed from Tags "updated" in issues atom are "created on" to Atom feed for issues incorrectly uses created time instead of updated time for "updated" elements
- Target version changed from Candidate for next major release to 6.0.0
Setting the target version to 6.0.0.
Updated by Go MAEDA 10 months ago
- Subject changed from Atom feed for issues incorrectly uses created time instead of updated time for "updated" elements to Fix Atom feed for issues to correctly use the updated time for "updated" element instead of the created time
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix in r22764.
Updated by Marius BĂLTEANU 10 months ago
3 tests fail after this change:
Failure:
ActivitiesControllerTest#test_previous_project_index [test/functional/activities_controller_test.rb:91]:
Expected: /1/
Actual: "Project".
Expected 0 to be >= 1.
bin/rails test test/functional/activities_controller_test.rb:80
.F
Failure:
ActivitiesControllerTest#test_global_index [test/functional/activities_controller_test.rb:103]:
Expected: /28/
Actual: "Project".
Expected 0 to be >= 1.
bin/rails test test/functional/activities_controller_test.rb:95
..F
Failure:
ActivitiesControllerTest#test_user_index [test/functional/activities_controller_test.rb:123]:
Expected: /1/
Actual: "Project".
Expected 0 to be >= 1.
bin/rails test test/functional/activities_controller_test.rb:107
You can see the status here https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-3.2_1017.html
On my local environment, reverting this change fixes all tests.
Updated by Marius BĂLTEANU 10 months ago
- Status changed from Closed to Reopened
Updated by Go MAEDA 10 months ago
- Target version changed from 6.0.0 to Candidate for next major release
Marius BĂLTEANU wrote in #note-9:
3 tests fail after this change:
[...]
You can see the status here https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-3.2_1017.html
On my local environment, reverting this change fixes all tests.
Thank you, I have reverted the change in r22770.