Defect #34933

Atom feed of the activity page does not contain items after the second page

Added by Yuichi HARADA 6 months ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Activity view
Target version:4.1.3
Resolution:Fixed Affected version:

Description

I'm receiving Atom feeds on the Activity.
I thought I was receiving the number of feeds set in Administration > Settings > General > Maximum number of items in Atom feeds, but actually I received only the events displayed on the first page of the Activity.

34933.patch Magnifier (1.49 KB) Yuichi HARADA, 2021-03-19 06:48

34933-v2.patch Magnifier (1.48 KB) Go MAEDA, 2021-04-09 07:22


Related issues

Related to Redmine - Patch #35413: Add missing fixtures to ActivitiesControllerTest Closed

Associated revisions

Revision 20931
Added by Go MAEDA 6 months ago

Atom feed of the activity page does not contain items after the second page (#34933).

Patch by Yuichi HARADA.

Revision 20933
Added by Go MAEDA 6 months ago

Merged r20931 from trunk to 4.2-stable (#34933).

Revision 20934
Added by Go MAEDA 6 months ago

Merged r20931 from trunk to 4.1-stable (#34933).

Revision 21046
Added by Go MAEDA 3 months ago

Add missing fixtures to ActivitiesControllerTest (#34933, #35413).

Patch by Yuichi HARADA.

Revision 21047
Added by Go MAEDA 3 months ago

Merged r21046 from trunk to 4.2-stable (#34933, #35413).

Revision 21048
Added by Go MAEDA 3 months ago

Merged r21046 from trunk to 4.1-stable (#34933, #35413).

History

#1 Updated by Yuichi HARADA 6 months ago

I created a patch.

diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index 745a40219..e1bba49f6 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -55,7 +55,12 @@ class ActivitiesController < ApplicationController
       end
     end

-    events = @activity.events(@date_from, @date_to)
+    events =
+      if params[:format] == 'atom'
+        @activity.events(nil, nil, :limit => Setting.feeds_limit.to_i)
+      else
+        @activity.events(@date_from, @date_to)
+      end

     if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
       respond_to do |format|

#2 Updated by Go MAEDA 6 months ago

  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release

#3 Updated by Go MAEDA 6 months ago

  • File 34933-v2.patchMagnifier added
  • Subject changed from Received Atom feed entries only of the first page of Activity to Atom feed of the activity page does not contain items after the second page
  • Target version changed from Candidate for next minor release to 4.1.3

In 34933-v2.patch, I have changed the test name.

#4 Updated by Go MAEDA 6 months ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

#5 Updated by Go MAEDA 6 months ago

  • Status changed from Resolved to Closed

#6 Updated by Go MAEDA 3 months ago

  • Related to Patch #35413: Add missing fixtures to ActivitiesControllerTest added

Also available in: Atom PDF