Project

General

Profile

Actions

Defect #11508

closed

Projects not ordered alphabetically after renaming project

Added by Cassiano Monteiro over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Projects
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I have several projects on my Redmine database, and they are shown on the "Project" combo on the top right corner of the screen, as well as on the "Projects" main page.

I had a project called "Old EPOP". After changing it´s name to "EPOP Desktop" (on the project settings screen), the "Projects" main page and the combo keep showing the order as it was before, instead of ordering the projects alphabetically. Attached are some screenshots.


Files

projects_combo.png (13.3 KB) projects_combo.png Project combo Cassiano Monteiro, 2012-07-25 16:02
projects_screen.png (24.3 KB) projects_screen.png Projects main screen Cassiano Monteiro, 2012-07-25 16:02
plugin_list.png (49.4 KB) plugin_list.png Cassiano Monteiro, 2012-07-30 19:45
NestedSetFix.patch (4.17 KB) NestedSetFix.patch William Roush, 2012-07-31 06:43
AwesomeNestedSetOrderUpdatePatch.patch (5.5 KB) AwesomeNestedSetOrderUpdatePatch.patch William Roush, 2012-08-05 03:21

Related issues

Related to Redmine - Feature #11539: Display a projects tree instead of a flat list in notification preferencesClosedJean-Philippe Lang

Actions
Related to Redmine - Feature #6836: Sort project list by Name instead of identifierClosedJean-Philippe Lang2010-11-05

Actions
Actions #1

Updated by Cassiano Monteiro over 11 years ago

Projects Screen:

Projects main screen

Projects Combo:

Project combo

Actions #2

Updated by William Roush over 11 years ago

Only affects sub-projects, not root level projects. Confirmed on trunk for me.

If I'm not mistaken, this is handled by awesome_nested_set, is this a bug that is causing it to not update it's properties correctly? Or Redmine's fault?

Actions #3

Updated by William Roush over 11 years ago

For a quick temporary fix: move that project into another project and then back in, it'll fix the ordering issue.

Not being familiar with awesome_nested_set, I have no clue what is different in that circumstance.

Actions #4

Updated by Cassiano Monteiro over 11 years ago

Is this aewsome_nested_set a plugin? I don´t have it.

For information, here is my plugin list:

Actions #5

Updated by William Roush over 11 years ago

Cassiano Monteiro wrote:

Is this aewsome_nested_set a plugin? I don´t have it.

For information, here is my plugin list:

It's shipped with Redmine, /lib/plugins/awesome_nested_set.

Actions #6

Updated by William Roush over 11 years ago

Confirmed it's the nested set, attached is a patch that will rebuild the order if the name has been changed on save and a test that replicates this bug.

Actions #7

Updated by Cassiano Monteiro over 11 years ago

Cool! Thanks!

Actions #8

Updated by Etienne Massip over 11 years ago

Confirmed on trunk.

About the patch, it would be great if there were a possibility to move the tree rebuild code to a more generic form in awesome_nested_set (haven't dug enough to say if it's actually possible).

Actions #9

Updated by Etienne Massip over 11 years ago

  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release
Actions #10

Updated by William Roush over 11 years ago

Etienne Massip wrote:

Confirmed on trunk.

About the patch, it would be great if there were a possibility to move the tree rebuild code to a more generic form in awesome_nested_set (haven't dug enough to say if it's actually possible).

I'll go ahead and investigate that.

Actions #11

Updated by William Roush over 11 years ago

Attached is a fairly rough idea of how I think it could work (of course tweaks would be nice, I'm pretty rough with Ruby and Rails)

I also noticed we have a field called "order" that isn't default in awesome_nested_set, so it almost looks like we were on the track towards doing this anyway but stopped short.

Input?

Actions #12

Updated by William Roush over 11 years ago

Should this be done differently? Or is this good enough for the next minor release?

Actions #13

Updated by Jean-Philippe Lang over 11 years ago

  • Assignee set to Jean-Philippe Lang
  • Target version changed from Candidate for next minor release to 2.1.0
Actions #14

Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from Confirmed to Closed
  • Resolution set to Fixed
Fix committed in r10187 with some changes:
  • use of an after_save filter instead of overriding #save (cleaner and everything runs in a db transaction)
  • no change to awesome_nested_set some we can upgrade/unvendor it more easily
  • no need to call Issue.update_versions_from_hierarchy_change when renaming a project
  • additional tests

Thanks for digging into this.

Actions

Also available in: Atom PDF