Defect #11880

Alternate theme colors by issue priority in issue list is wrong

Added by amree woot about 5 years ago. Updated almost 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution:Wont fix Affected version:2.1.0

Description

The issue list is using priority-4 for the normal priority issue (fresh Redmine installation uses priority-2)

Is this a bug? I noticed it after upgrading to Redmine 2.1.0. Changing the theme to the default theme doesn't fix it. I'm also not using any plugin.


Ruby version              1.9.3 (i686-linux)
RubyGems version          1.8.19
Rack version              1.4
Rails version             3.2.8
Active Record version     3.2.8
Action Pack version       3.2.8
Active Resource version   3.2.8
Action Mailer version     3.2.8
Active Support version    3.2.8
Middleware                Rack::Cache, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x861fc44>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, OpenIdAuthentication
Application root          /opt/redmine
Environment               production
Database adapter          mysql2
Database schema version   20120731164049

screenshot.png - screenshot using google dev tools (151 KB) amree woot, 2012-09-19 12:10

application.css Magnifier (3.19 KB) Julien Petit, 2012-09-22 11:04

css_classes_with_position.diff Magnifier (524 Bytes) Clemens Bergmann, 2013-01-03 22:25


Related issues

Related to Redmine - Defect #11869: Issue.css_classes set wrong priority number Closed
Related to Redmine - Defect #2071: Reordering priority-enumerations breaks alternate-theme's... Closed 2008-10-22
Duplicated by Redmine - Defect #12057: CSS class about issue priority is possibly based on the e... Closed
Duplicated by Redmine - Defect #13840: Style issues by priority position, not id Closed

History

#1 Updated by amree woot about 5 years ago

This is my current table for enumerations:

mysql> select * from enumerations;
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+
| id | name                    | position | is_default | type              | active | project_id | parent_id |
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+
|  1 | User documentation      |        1 |          0 | DocumentCategory  |      1 |       NULL |      NULL |
|  2 | Technical documentation |        2 |          0 | DocumentCategory  |      1 |       NULL |      NULL |
|  3 | Low                     |        1 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  4 | Normal                  |        2 |          1 | IssuePriority     |      1 |       NULL |      NULL |
|  5 | High                    |        3 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  6 | Urgent                  |        4 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  7 | Immediate               |        5 |          0 | IssuePriority     |      1 |       NULL |      NULL |
|  8 | Design                  |        1 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
|  9 | Development             |        2 |          0 | TimeEntryActivity |      1 |       NULL |      NULL |
+----+-------------------------+----------+------------+-------------------+--------+------------+-----------+

#2 Updated by Etienne Massip about 5 years ago

  • Subject changed from Issue row list is generating wrong css class for the priority to Alternate theme colors by issue priority in issue list is wrong
  • Status changed from New to Confirmed
  • Priority changed from Low to Normal
  • Target version set to 2.1.1

CSS class is ok, see #11869.

But Julien is right: Alternate theme has not been updated according to change in #2071.

#3 Updated by Julien Petit about 5 years ago

If it can be of use to someone, i've patched the css. It works on my installation with the same table that amree woot is sharing here.

#4 Updated by amree woot about 5 years ago

Working good for me (I'm using basecamp theme)

#5 Updated by Miklós Balázs about 5 years ago

The problem is that when generating the CSS class to use, it takes into account the ID of the enumeration instead of the position field.

#6 Updated by Julien Petit about 5 years ago

Miklós Balázs wrote:

The problem is that when generating the CSS class to use, it takes into account the ID of the enumeration instead of the position field.

This is not a problem, this is a change in the last releases because re-ordering position add the effect of changing status colors. The id is less likely to change.

#7 Updated by Jean-Philippe Lang about 5 years ago

  • Status changed from Confirmed to Closed
  • Target version deleted (2.1.1)
  • Resolution set to Wont fix

The theme is OK when creating default priorities with 2.1.0.
If you use this theme with priorities created previously, you'll have to adjust the css manually according to your priority ids.

#8 Updated by John Reynolds about 5 years ago

I just saw this closed (suprised) and thought I should add that I've never once changed the order or setup of the issue priority enumerations and yet the problem exists for me. I guess if the statement is, 'adjust your css' then ok, but it's not a result of custom setup I think?

#9 Updated by Anonymous about 5 years ago

I agree with John Reynolds, please see A1

#10 Updated by Eric Platon almost 5 years ago

I am also surprised that this ticket is closed. Comparing the code of 1.2.2 and 2.1.2, this appears to be a bug. Priorities were based on position before, and it seems a better choice than ID, which is just a default value set by the install script and may depend on the DB engine. My DB has been modified, after years of usage, and the match does not exist anymore.

Shifting the priority index in themes will work as long as priorities are not customized in Redmine.

For the record, I have tried 4 themes, and they all break consistently from 2.1.

#11 Updated by Clemens Bergmann almost 5 years ago

hi,

for all that have this BUG i attach a patch against stable 2.1 which changes the behavior back. The rows now get the position and not the ID as css class.

#12 Updated by Mischa The Evil about 4 years ago

  • Duplicated by Defect #13840: Style issues by priority position, not id added

#13 Updated by Vaclav Fiser almost 3 years ago

Hi,

We're facing this issue again in Redmine version 2.6.0 with custom theme. Unfortunately provided patch isn't compatible with latest version.
Can someone please help us ? Thank you

Also available in: Atom PDF