Project

General

Profile

Actions

Defect #11098

closed

Default priorities have the same position and can't be reordered

Added by Stanislav German-Evtushenko almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
High
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

CSS class "priority-N" doesn't depend on an issue priority anymore and it is always "priority-2". As a result - alnernate theme priority colours don't work.

It worked well in 1.4-stable.


Files

enumeration.png (71.8 KB) enumeration.png Stanislav German-Evtushenko, 2012-06-06 10:45
production.sqlite3 (214 KB) production.sqlite3 Stanislav German-Evtushenko, 2012-06-06 21:19
enumerations.png (18.6 KB) enumerations.png Etienne Massip, 2012-06-08 01:03
Actions #1

Updated by Etienne Massip almost 12 years ago

  • Resolution set to Cant reproduce

Works fine on trunk and I don't think there has been some fix committed related to this issue.

Actions #2

Updated by Stanislav German-Evtushenko almost 12 years ago

  • please have a look: http://redmine.ourproject.org/projects/kune/issues
    
      <tr id="issue-284" class="hascontextmenu odd issue status-1 priority-2">
        <td class="checkbox hide-when-print"><input name="ids[]" value="284" type="checkbox"></td>
        <td class="id"><a href="/issues/284">284</a></td>
            <td class="tracker">Bug</td><td class="status">New</td><td class="priority">High</td><td class="subject"><a href="/issues/284">Add time in errors</a></td><td class="assigned_to"><a href="/users/4">Vicente J. Ruiz Jurado</a></td><td class="updated_on">06/05/2012 03:07 am</td>
      </tr>
      <tr id="issue-283" class="hascontextmenu even issue status-1 priority-2">
        <td class="checkbox hide-when-print"><input name="ids[]" value="283" type="checkbox"></td>
        <td class="id"><a href="/issues/283">283</a></td>
            <td class="tracker">Bug</td><td class="status">New</td><td class="priority">High</td><td class="subject"><a href="/issues/283">Create custom "More" menu in Kune</a></td><td class="assigned_to"><a href="/users/4">Vicente J. Ruiz Jurado</a></td><td class="updated_on">06/05/2012 02:05 am</td>
      </tr>
      <tr id="issue-282" class="hascontextmenu odd issue status-1 priority-2">
        <td class="checkbox hide-when-print"><input name="ids[]" value="282" type="checkbox"></td>
        <td class="id"><a href="/issues/282">282</a></td>
            <td class="tracker">Bug</td><td class="status">New</td><td class="priority">Normal</td><td class="subject"><a href="/issues/282">The unread notification in the header does not get updated automatically sometimes</a></td><td class="assigned_to"><a href="/users/4">Vicente J. Ruiz Jurado</a></td><td class="updated_on">06/04/2012 12:08 am</td>
      </tr>
      <tr id="issue-281" class="hascontextmenu even issue status-1 priority-2">
        <td class="checkbox hide-when-print"><input name="ids[]" value="281" type="checkbox"></td>
        <td class="id"><a href="/issues/281">281</a></td>
            <td class="tracker">Bug</td><td class="status">New</td><td class="priority">High</td><td class="subject"><a href="/issues/281">Cannot load waves, frequently (video)</a></td><td class="assigned_to"><a href="/users/4">Vicente J. Ruiz Jurado</a></td><td class="updated_on">06/02/2012 07:21 pm</td>
      </tr>
    
Actions #3

Updated by Stanislav German-Evtushenko almost 12 years ago

  • From Administration -> Information page:
    Information
    
    Redmine 2.0.2.stable.9774
    Default administrator account changed     True
    Attachments directory writable     True
    Plugin assets directory writable     True
    RMagick available (optional)     True
    
    Environment:
      Redmine version                          2.0.2.stable.9774
      Ruby version                             1.9.3 (i686-linux)
      Rails version                            3.2.5
      Environment                              production
      Database adapter                         SQLite
    Redmine plugins:
      no plugin installed
    
Actions #4

Updated by Etienne Massip almost 12 years ago

Indeed.

Did you make some manual changes to Issue#css_classes (source:/tags/2.0.2/app/models/issue.rb#L682)?

What's your enumerations table contents looks like?

Actions #5

Updated by Etienne Massip almost 12 years ago

  • Affected version (unused) changed from 2.0.1 to 2.0.2
  • Affected version changed from 2.0.1 to 2.0.2
Actions #6

Updated by Stanislav German-Evtushenko almost 12 years ago

Nothing were changed at all. Enumerations also were not changed. Screenshot is attached.

Actions #8

Updated by Etienne Massip almost 12 years ago

Sorry, no clue.

Could you please post the database enumerations table contents?

Actions #9

Updated by Stanislav German-Evtushenko almost 12 years ago

Sorry, I don't have an access to the database currently but I made the same test with a clean database that was just migrated and data default was loaded - same result.

Actions #10

Updated by Stanislav German-Evtushenko almost 12 years ago

database example is attached

Actions #11

Updated by Etienne Massip almost 12 years ago

There is something wrong with your enumerations table contents:

Every IssuePriority except Low has a position of 2.

Actions #12

Updated by Stanislav German-Evtushenko almost 12 years ago

Etienne Massip wrote:

There is something wrong with your enumerations table contents:

Every IssuePriority except Low has a position of 2.

That clear database just migrated and English default data loaded. Can it be database migation or sqlite3 problem?
So, as a workaround I can try fix database manually, right?

Actions #13

Updated by Stanislav German-Evtushenko almost 12 years ago

I have just tried to change position using admin interface - doesn't work. I'm not sure why but only 1 and 2 are possible. If I click "Move down" again it does nothing.

Actions #14

Updated by Etienne Massip almost 12 years ago

  • Status changed from New to Confirmed
  • Priority changed from Normal to High
  • Target version set to Candidate for next minor release
  • Resolution deleted (Cant reproduce)

You're just right, just reproduced it very easily with a simple db:migrate redmine:load_default_data sequence.

Actions #16

Updated by Etienne Massip almost 12 years ago

There's an open Rails issue about this behavior.

What I don't get is that it used to work but still I can reproduce even with 1.4 branch???

Here's a simple patch to fix it:

Index: lib/plugins/acts_as_list/lib/active_record/acts/list.rb
===================================================================
--- lib/plugins/acts_as_list/lib/active_record/acts/list.rb    (revision 9776)
+++ lib/plugins/acts_as_list/lib/active_record/acts/list.rb    (working copy)
@@ -209,7 +209,7 @@
           def bottom_item(except = nil)
             conditions = scope_condition
             conditions = "#{conditions} AND #{self.class.primary_key} != #{except.id}" if except
-            acts_as_list_class.find(:first, :conditions => conditions, :order => "#{position_column} DESC")
+            acts_as_list_class.where(conditions).reorder("#{position_column} DESC").first
           end

           # Forces item to assume the bottom position in the list.

Last thought: specifying the value of the position field in loader is useless since it will be set by acts_as_list in the end.

Actions #17

Updated by Etienne Massip almost 12 years ago

  • Target version changed from Candidate for next minor release to 2.0.3

Worth it (1.4.4?).

Actions #18

Updated by Stanislav German-Evtushenko almost 12 years ago

Etienne, same for me. When I first installed Redmine 1.4.1 (and we've been still using it) there was no such problem. Then we upgraded to 1.4.2 and it still works well.

Actions #19

Updated by Jean-Philippe Lang almost 12 years ago

It seems to affect 2.0.x only. Data loading works fine with 1.4.x for me.

Actions #20

Updated by Etienne Massip almost 12 years ago

Jean-Philippe Lang wrote:

It seems to affect 2.0.x only. Data loading works fine with 1.4.x for me.

I ran the IssuePriority.create! in rails console and saw that the statement was the same as in 2.x with the two sorting specifications in the same wrong order.

Maybe is there some final override if you specify the :position column value in Rails 2.3.

Or, more probably, I missed something.

Edit: I confirm it worked on 1.4

Actions #21

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from priority-N for CSS doesn't work to Default priorities have the same position and can't be reordered
Actions #22

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r9781. Priorities are now created correctly. For existing priorities with the same position, you can now reorder them properly (they will be automatically fixed and updated to sequential numbers the first time you move one priority in the list).

Actions #23

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from Resolved to Closed

Merged.

Actions

Also available in: Atom PDF