redmica / redmine_issues_panel

36 stars 14 forks source link

500 INTERNAL ERROR with plugin redmine_tags #47

Open ashrafalzyoud opened 1 year ago

ashrafalzyoud commented 1 year ago
issues_panel/issue_query_patch.rb:14:in `build_from_params'

plugins/redmineup_tags/lib/redmineup_tags/patches/issue_query_patch.rb:64:in build_from_params_with_redmine_tags' plugins/redmine_issues_panel/lib/redmine_issues_panel/issue_query_patch.rb:14:inbuild_from_params' plugins/redmineup_tags/lib/redmineup_tags/patches/issue_query_patch.rb:64:in build_from_params_with_redmine_tags' plugins/redmine_issues_panel/lib/redmine_issues_panel/issue_query_patch.rb:14:inbuild_from_params' plugins/redmineup_tags/lib/redmineup_tags/patches/issue_query_patch.rb:64:in build_from_params_with_redmine_tags' plugins/redmine_issues_panel/lib/redmine_issues_panel/issue_query_patch.rb:14:inbuild_from_params'

ashrafalzyoud commented 1 year ago
 64       def build_from_params_with_redmine_tags(params, defaults = {})
          Redmine::VERSION.to_s > '4' ? build_from_params_without_redmine_tags(params, defaults) : build_from_params_without_redmine_tags(params)

          add_filter('issue_tags', '=', [RedmineCrm::Tag.find_by(id: params[:tag_id]).try(:name)]) if params[:tag_id].present?
        end
      def build_from_params(params, defaults={})
   14     super
        self.issues_num_per_row =
          params[:issues_num_per_row] ||
            (params[:query] && params[:query][:issues_num_per_row]) ||
            options[:issues_num_per_row]
        self
      end
ashrafalzyoud commented 1 year ago

if im change line 13 def build_from_params_without_redmine_tags(params, defaults={}) its working are this solution ok or no??

ashrafalzyoud commented 1 year ago

@takenory @salmanmp

salmanmp commented 1 year ago

There is two way to patch a class existing function. Using alias_method and prepend module. If you do patch on same function in both ways, you will fall in loop and get such error mentioned in first message.

ashrafalzyoud commented 1 year ago

@salmanmp ok then how i can fix it

salmanmp commented 1 year ago

@salmanmp ok then how i can fix it

As I mentioned, you must make all of pathces on one function, the same way.

ashrafalzyoud commented 1 year ago

i dont know how if u can help plz?