From 9808ad87ed349553e58b6dcb85131daedbb49f9c Mon Sep 17 00:00:00 2001 From: Vegaminer Date: Fri, 24 Jan 2020 16:57:58 +0300 Subject: [PATCH 1/6] RAILS 5.2 --- db/migrate/001_issue_category_acts_as_nested_set.rb | 2 +- db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/001_issue_category_acts_as_nested_set.rb b/db/migrate/001_issue_category_acts_as_nested_set.rb index 6e32209..c8ffec2 100644 --- a/db/migrate/001_issue_category_acts_as_nested_set.rb +++ b/db/migrate/001_issue_category_acts_as_nested_set.rb @@ -1,4 +1,4 @@ -class IssueCategoryActsAsNestedSet < ActiveRecord::Migration +class IssueCategoryActsAsNestedSet < ActiveRecord::Migration[4.2] def self.up add_column :issue_categories, :parent_id, :integer, :null => true diff --git a/db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb b/db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb index ee68692..973d926 100644 --- a/db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb +++ b/db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb @@ -1,4 +1,4 @@ -class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration +class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration[4.2] def self.up change_column :issue_categories, :lft, :integer, :null => false, :default => '0' change_column :issue_categories, :rgt, :integer, :null => false, :default => '0' From 76dc5bcb19abf54ae5fa1c6bf2527d0798fb74d2 Mon Sep 17 00:00:00 2001 From: Vegaminer Date: Wed, 26 Feb 2020 18:14:27 +0300 Subject: [PATCH 2/6] Small fix for format_object to play nicely with other plugings --- init.rb | 2 +- .../patches/application_helper_patch.rb | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/init.rb b/init.rb index c8d7f26..f24997d 100644 --- a/init.rb +++ b/init.rb @@ -13,7 +13,7 @@ require File.dirname(__FILE__) + '/app/views/helpers/redmine_category_tree/issue_category_helper.rb' Rails.configuration.to_prepare do -#((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do +#((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do ## Helpers first require_dependency 'application_helper' diff --git a/lib/redmine_category_tree/patches/application_helper_patch.rb b/lib/redmine_category_tree/patches/application_helper_patch.rb index 106a770..2f5178b 100644 --- a/lib/redmine_category_tree/patches/application_helper_patch.rb +++ b/lib/redmine_category_tree/patches/application_helper_patch.rb @@ -1,7 +1,19 @@ module RedmineCategoryTree module Patches module ApplicationHelperPatch - def format_object(object, html=true, &block) + def self.included(base) + base.send(:include, InstanceMethods) + + base.class_eval do + unloadable + + alias_method :format_object_without_category_tree, :format_object + alias_method :format_object, :format_object_with_category_tree + + end + end + + def format_object_with_category_tree(object, html=true, &block) if block_given? object = yield object end @@ -9,9 +21,10 @@ def format_object(object, html=true, &block) when 'IssueCategory' render_issue_category_with_tree_inline(object) else - super + # super + format_object_without_category_tree(object, html, &block) end end end end -end \ No newline at end of file +end From 7c8c7f8edd579059c4fedcf00b58294af03f6ce6 Mon Sep 17 00:00:00 2001 From: Vegaminer Date: Fri, 28 Feb 2020 09:27:19 +0300 Subject: [PATCH 3/6] to_prepare fix --- init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.rb b/init.rb index f24997d..39ba711 100644 --- a/init.rb +++ b/init.rb @@ -12,8 +12,8 @@ require 'redmine_category_tree/hooks/redmine_category_tree_hooks' require File.dirname(__FILE__) + '/app/views/helpers/redmine_category_tree/issue_category_helper.rb' -Rails.configuration.to_prepare do -#((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do +#Rails.configuration.to_prepare do +((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do ## Helpers first require_dependency 'application_helper' From bc38f10ffb799fbf19ca5737156cee7bdfcabda5 Mon Sep 17 00:00:00 2001 From: Tomasz Witke Date: Fri, 4 Mar 2022 11:42:23 +0100 Subject: [PATCH 4/6] Fix compatybility with other plugins --- lib/redmine_category_tree/patches/issue_query_patch.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine_category_tree/patches/issue_query_patch.rb b/lib/redmine_category_tree/patches/issue_query_patch.rb index 5b022ec..a44bb94 100644 --- a/lib/redmine_category_tree/patches/issue_query_patch.rb +++ b/lib/redmine_category_tree/patches/issue_query_patch.rb @@ -7,7 +7,7 @@ def self.prepended(base) end end - def initialize_available_filters + def initialize_available_filters_category_tree super add_available_filter "category_id", :type => :list_optional, @@ -15,4 +15,4 @@ def initialize_available_filters end end end -end \ No newline at end of file +end From 48dbf9f0ea89bbe0b766efbd67a42cf5abb08dd9 Mon Sep 17 00:00:00 2001 From: Tomasz Witke Date: Fri, 4 Mar 2022 11:43:02 +0100 Subject: [PATCH 5/6] Fix compatybility with other plugins --- lib/redmine_category_tree/patches/queries_helper_patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine_category_tree/patches/queries_helper_patch.rb b/lib/redmine_category_tree/patches/queries_helper_patch.rb index fc3406e..4e276bb 100644 --- a/lib/redmine_category_tree/patches/queries_helper_patch.rb +++ b/lib/redmine_category_tree/patches/queries_helper_patch.rb @@ -3,7 +3,7 @@ module Patches module QueriesHelperPatch include RedmineCategoryTree::IssueCategoryHelper - def column_content(column, issue) + def column_content_category_tree(column, issue) if column.name == :category render_issue_category_with_tree(issue.category) else From dccd4c813b2d6021b5f7a74545501fca41654f12 Mon Sep 17 00:00:00 2001 From: Tomasz Witke Date: Fri, 4 Mar 2022 11:44:30 +0100 Subject: [PATCH 6/6] Fix compatibility with other plugins --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1f030db..d27b486 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,10 @@ This will move the selected category to the bottom of the list for that project # Revision History +## 1.0.1 +* Updated to work with Redmine 4.2.3.stable +* Fix compatibility with other plugins + ## 1.0.0 * Add support for Rails >= 5