プロジェクト

全般

プロフィール

Vote #72286

完了

Projects not ordered alphabetically after renaming project

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Projects_11
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
11
version_id:
47
issue_org_id:
11508
author_id:
28747
assigned_to_id:
1
comments:
14
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
53
ステータス-->[Closed]

説明

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.


journals

Projects Screen:

!projects_screen.png!

Projects Combo:

!projects_combo.png!
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Is this aewsome_nested_set a plugin? I don´t have it.

For information, here is my plugin list:

!plugin_list.png!
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------
Cool! Thanks!
--------------------------------------------------------------------------------
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).

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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?

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

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------


related_issues

relates,Closed,11539,Display a projects tree instead of a flat list in notification preferences
relates,Closed,6836,Sort project list by Name instead of identifier

Admin Redmine さんが4年以上前に更新

  • カテゴリProjects_11 にセット
  • 対象バージョン2.1.0_47 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0