From e9f854fa7cf855f10d92f1bfec29dd2f60cb522f Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Mon, 17 Sep 2018 10:22:29 +0200 Subject: [PATCH] fix color css rendering on non existing color For instances already/still having entries (priorities, status, ...) with color_id = 0, we need to check explicitly if the color exists --- app/views/highlighting/styles.css.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/highlighting/styles.css.erb b/app/views/highlighting/styles.css.erb index 7a9a23f0db2..fba32156c58 100644 --- a/app/views/highlighting/styles.css.erb +++ b/app/views/highlighting/styles.css.erb @@ -1,12 +1,13 @@ <% colored_resource = Proc.new do |name, scope| scope.includes(:color).find_each do |entry| - if entry.color_id.nil? + color = entry.color + + if color.nil? concat ".__hl_dot_#{name}_#{entry.id}::before { display: none }\n" next end - color = entry.color styles = color.color_styles inline_style = styles.map{|k,v| "#{k}:#{v} !important"}.join(';')