プロジェクト

全般

プロフィール

Vote #68550

完了

Clicking "Add" twice creates duplicate member record

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

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Permissions and roles_17
対象バージョン:
開始日:
2010/11/04
期日:
進捗率:

100%

予定工数:
category_id:
17
version_id:
20
issue_org_id:
6826
author_id:
23094
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
25
ステータス-->[Closed]

説明

When editing members for a project:

If you select a user and click "Add" twice before the server request is completed, it will add a duplicate member record. It then shows up as two items in the projects dropdown menu, and probably other side-effects.

Possible solutions:

  1. Add a unique key on members (user_id, project_id)
  2. Prevent accidental re-submit on the front end, by disabling the button until ajax completes.

journals

I made a quick patch for the button UI on my github fork:

https://github.com/avit/redmine/commit/78c57faf4200cd7b3717ea5e8df338338a151f67

The members model has a validates_uniqueness_of that should prevent another record with the same value from being created, but maybe because happened concurrently from the double click, it couldn't verify uniqueness. Does this warrant adding a database constraint?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I've applied your patch and added the unique index on members table.
Thanks.
--------------------------------------------------------------------------------
Any changes of get similar fix (don't allow double submitting) for the #6579? It's really a very dangerous bug without workaround.
--------------------------------------------------------------------------------

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

  • カテゴリPermissions and roles_17 にセット
  • 対象バージョン1.1.0_20 にセット

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

いいね!0
いいね!0