]> source.dussan.org Git - redmine.git/commitdiff
Atom feed of the activity page does not contain items after the second page (#34933).
authorGo MAEDA <maeda@farend.jp>
Mon, 12 Apr 2021 09:10:41 +0000 (09:10 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 12 Apr 2021 09:10:41 +0000 (09:10 +0000)
Patch by Yuichi HARADA.

git-svn-id: http://svn.redmine.org/redmine/trunk@20931 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/activities_controller.rb
test/functional/activities_controller_test.rb

index 5f522c83156ed21ebebaec2da0ec632e8c5a416d..cce17aef26af270c944bf0e4a91d55d95bee280b 100644 (file)
@@ -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|
index f004b6b74c1557b5dac1c53a8bf239e21f6274c5..6bc43da5e8353bf61002c240c7717f3010b97cb8 100644 (file)
@@ -125,6 +125,22 @@ class ActivitiesControllerTest < Redmine::ControllerTest
     end
   end
 
+  def test_index_atom_feed_should_respect_feeds_limit_setting
+    with_settings :feeds_limit => '20' do
+      get(
+        :index,
+        :params => {
+          :format => 'atom'
+        }
+      )
+    end
+    assert_response :success
+
+    assert_select 'feed' do
+      assert_select 'entry', :count => 20
+    end
+  end
+
   def test_index_atom_feed_with_explicit_selection
     get(
       :index,