Project

General

Profile

Actions

Defect #39519

closed

500 Error when trying to add certain fields with the Add Filter feature

Added by Christopher Barnes 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Filters
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I've noticed after upgrading to Redmine 5.0.5.stable, if you have both the Easy Gantt and Redmine Agile PRO plugins enabled at the same time, you receive a 500 Internal Server error when trying to add certain fields with the Add Filter feature. I've reached out to the developers of the respective plugins, but I wonder if this is an issue that has been noticed by your team as well. In production.log, I'm seeing the following:

I, [2023-11-06T12:29:58.547562 #30029]  INFO -- : [d01219b0-1618-4911-9453-2d2c0014a87d] Started GET "/queries/filter?type=ProjectQuery&name=id" for 72.212.100.43 at 2023-11-06 12:29:58 -0700
I, [2023-11-06T12:29:58.548702 #30029]  INFO -- : [d01219b0-1618-4911-9453-2d2c0014a87d] Processing by QueriesController#filter as JSON
I, [2023-11-06T12:29:58.548806 #30029]  INFO -- : [d01219b0-1618-4911-9453-2d2c0014a87d]   Parameters: {"type"=>"ProjectQuery", "name"=>"id"}
I, [2023-11-06T12:29:58.555854 #30029]  INFO -- : [d01219b0-1618-4911-9453-2d2c0014a87d]   Current user: cdbarnes (id=349)
I, [2023-11-06T12:29:58.591092 #30029]  INFO -- : [d01219b0-1618-4911-9453-2d2c0014a87d] Completed 500 Internal Server Error in 42ms (ActiveRecord: 2.1ms | Allocations: 42551)
F, [2023-11-06T12:29:58.631478 #30029] FATAL -- : [d01219b0-1618-4911-9453-2d2c0014a87d]
[d01219b0-1618-4911-9453-2d2c0014a87d] SystemStackError (stack level too deep):
[d01219b0-1618-4911-9453-2d2c0014a87d]
[d01219b0-1618-4911-9453-2d2c0014a87d] plugins/redmine_agile/lib/redmine_agile/patches/queries_controller_patch.rb:35:in `query_class_with_agile'
[d01219b0-1618-4911-9453-2d2c0014a87d] plugins/easy_gantt/lib/easy_gantt/queries_controller_patch.rb:17:in `query_class'
[d01219b0-1618-4911-9453-2d2c0014a87d] app/controllers/queries_controller.rb:92:in `filter'
[d01219b0-1618-4911-9453-2d2c0014a87d] lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Actions #1

Updated by Pavel Rosický 11 months ago

unfortunately, using alias_method_chain is obsolete and it cannot be combined with prepend if any other plugin patches the same method. There is nothing Redmine could do to prevent that.

try this (untested :)) patch

./lib/redmine_agile/patches/queries_controller_patch.rb

module RedmineAgile
  module Patches
    module QueriesControllerPatch
      def self.included(base)
        base.prepend(InstanceMethods)
      end

      module InstanceMethods
        def query_class
          return AgileChartsQuery if params[:type] == 'AgileChartsQuery'
          super
        end
      end
    end
  end
end

unless QueriesController.included_modules.include?(RedmineAgile::Patches::QueriesControllerPatch)
  QueriesController.include RedmineAgile::Patches::QueriesControllerPatch
end

Actions #2

Updated by Christopher Barnes 11 months ago

I have testing in our development instance of Redmine and this does fix the issue we are having. Thank you for your quick assistance with this!

Actions #3

Updated by Marius BĂLTEANU 11 months ago

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

Also available in: Atom PDF