プロジェクト

全般

プロフィール

Vote #80506

未完了

Add Project.find_by_name to target_project

Admin Redmine さんが約2年前に追加. 約2年前に更新.

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

0%

予定工数:
category_id:
29
version_id:
0
issue_org_id:
32522
author_id:
432329
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Consider issue #6694, fix is trivial. Think about all those reporters who struggle to memorizing all that ID stuff.

File app/models/mail_handler.rb
Line 410

target = get_project_from_receiver_addresses
target ||= Project.find_by_identifier(get_keyword(:project))
target ||= Project.find_by_name(get_keyword(:project)) # just one new line


journals

--------------------------------------------------------------------------------
Since project names may not be unique, I think we cannot add the suggested code.
--------------------------------------------------------------------------------
Well, it's a good point. But then we have two options:
1. Mark Project.find_by_name as a deprecated/potentially-dangerous method and eliminate it in future versions of RM "Since project names may not be unique".
2. Implement some system-wide option "Enforce unique project names" and if it's disabled (users may create projects with non-unique names) then find_by_name method should throw an exception telling something like this: "Either you force unique names at settings page of your project or don't use Project.find_by_name in your code"

By the way,

@root@sd-srv-redmine-01:/opt/redmine/app# grep -r find_by_name
helpers/application_helper.rb: link_project = Project.find_by_identifier(identifier) || Project.find_by_name(identifier)
models/wiki.rb: project = Project.find_by_identifier(project_identifier) || Project.find_by_name(project_identifier)@

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

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


related_issues

relates,Closed,630,Allow non-unique names for projects
duplicates,Closed,6694,Bug in project name when create issue by email

Admin Redmine さんが約2年前に更新

  • カテゴリEmail receiving_29 にセット

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

いいね!0
いいね!0