HugoHasenbein / redmine_project_themes

Redmine plugin for provides project specific themes
https://www.redmine.org/plugins/redmine_project_theme
GNU General Public License v2.0
7 stars 3 forks source link

Usage Error #4

Closed yuxinvalo closed 3 years ago

yuxinvalo commented 4 years ago

Hello, When I install this plugin and test it, I can't click the project anymore, it show Internal Error, when I check production.log:
image

What it means? I missi something?

CNPF commented 4 years ago

Hi, Try

git diff lib/redmine_project_themes/patches/redmine_theme_patch.rb diff --git a/lib/redmine_project_themes/patches/redmine_theme_patch.rb b/lib/redmine_project_themes/patches/redmine_theme_patch.rb index d225c6a..eae5fdc 100644 --- a/lib/redmine_project_themes/patches/redmine_theme_patch.rb +++ b/lib/redmine_project_themes/patches/redmine_theme_patch.rb @@ -31,7 +31,7 @@ module RedmineProjectThemes

unless (instance_variable_defined?(:@current_theme) && instance_variable_defined?(:@current_project_for_theme) && @current_project_for_theme == @project ) @current_project_for_theme = @project -@current_theme = (@project && @project.module_enabled?(:redmine_project_themes) && @project.ui_theme.present?) ? Redmine::Themes.theme(@project.ui_theme) : Redmine::Themes.theme(Setting.ui_theme) +@current_theme = (@project && @project.module_enabled?(:redmine_project_themes) && @project.theme_id.present?) ? Redmine::Themes.theme(@project.theme_id) : Redmine::Themes.theme(Setting.ui_theme) end

@current_theme

yuxinvalo commented 4 years ago

Hi, Try

git diff lib/redmine_project_themes/patches/redmine_theme_patch.rb diff --git a/lib/redmine_project_themes/patches/redmine_theme_patch.rb b/lib/redmine_project_themes/patches/redmine_theme_patch.rb index d225c6a..eae5fdc 100644 --- a/lib/redmine_project_themes/patches/redmine_theme_patch.rb +++ b/lib/redmine_project_themes/patches/redmine_theme_patch.rb @@ -31,7 +31,7 @@ module RedmineProjectThemes unless (instance_variable_defined?(:@current_theme) && instance_variable_defined?(:@current_project_for_theme) && @current_project_for_theme == @project ) @current_project_for_theme = @project -@current_theme = (@project && @project.module_enabled?(:redmine_project_themes) && @project.ui_theme.present?) ? Redmine::Themes.theme(@project.ui_theme) : Redmine::Themes.theme(Setting.ui_theme) +@current_theme = (@project && @project.module_enabled?(:redmine_project_themes) && @project.theme_id.present?) ? Redmine::Themes.theme(@project.theme_id) : Redmine::Themes.theme(Setting.ui_theme) end @current_theme

Thinks, it seems that I didn't install any theme in my Redmine XD.. So the plugin can't find ui,.. But I advise if there is no theme to choose, make a warning or something rather than an error ...

HugoHasenbein commented 4 years ago

Dear Yuxinvalo,

thank you for your feedback - I will install a warning to prevent a fault.

best regards

Stephan

Am 25.02.2020 um 15:02 schrieb yuxinvalo notifications@github.com:

Hi, Try

git diff lib/redmine_project_themes/patches/redmine_theme_patch.rb diff --git a/lib/redmine_project_themes/patches/redmine_theme_patch.rb b/lib/redmine_project_themes/patches/redmine_theme_patch.rb index d225c6a..eae5fdc 100644 --- a/lib/redmine_project_themes/patches/redmine_theme_patch.rb +++ b/lib/redmine_project_themes/patches/redmine_theme_patch.rb @@ -31,7 +31,7 @@ module RedmineProjectThemes unless (instance_variable_defined?(:@current_theme) && instance_variable_defined?(:@current_project_for_theme) && @current_project_for_theme == @project https://github.com/project ) @current_project_for_theme = @project https://github.com/project -@current_theme = (@project https://github.com/project && @project.module_enabled?(:redmine_project_themes) && @project.ui_theme.present?) ? Redmine::Themes.theme(@project.ui_theme) : Redmine::Themes.theme(Setting.ui_theme) +@current_theme = (@project https://github.com/project && @project.module_enabled?(:redmine_project_themes) && @project.theme_id.present?) ? Redmine::Themes.theme(@project.theme_id) : Redmine::Themes.theme(Setting.ui_theme) end @current_theme

Thinks, it seems that I didn't install any theme in my Redmine XD.. So the plugin can't find ui,.. But I advise if there is no theme to choose, make a warning or something rather than an error ...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HugoHasenbein/redmine_project_themes/issues/4?email_source=notifications&email_token=AJWRDRGYYOFNNRGZJV5DNT3REUQHDA5CNFSM4K3CAWN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4CFJI#issuecomment-590881445, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWRDRA2CGTBDEOQV7NJDP3REUQHDANCNFSM4K3CAWNQ.