プロジェクト

全般

プロフィール

Vote #81738

完了

Saving time tracking activities without any change may turn a system activity into a project activity

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

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

0%

予定工数:
category_id:
43
version_id:
155
issue_org_id:
36318
author_id:
362529
assigned_to_id:
332
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

If you save system activities without editing them in the project settings, some activities will be created as project-specific activities.

!reproduce.gif!


journals

The following patch will solve the issue. I have attached a patch.

<pre><code class="diff">
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index 5f0e023ed9..534d8239e1 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -117,7 +117,7 @@ class Enumeration < ActiveRecord::Base
# Does the +new+ Hash have the same custom values as the previous Enumeration?
def self.same_custom_values?(new, previous)
previous.custom_field_values.each do |custom_value|
- if custom_value.value != new["custom_field_values"][custom_value.custom_field_id.to_s]
+ if custom_value.to_s != new["custom_field_values"][custom_value.custom_field_id.to_s].to_s
return false
end
end
</code></pre>
--------------------------------------------------------------------------------
Could you explain the conditions that cause this issue?
--------------------------------------------------------------------------------
Go MAEDA wrote:
> Could you explain the conditions that cause this issue?

I understand the condition.

The issue occurs when the value of a custom field of the activity is @nil@, and the new value for the custom field in the "new" hash is unset (the value will be a blank string). As a result, the conditional expression of the if statement will be false and a project-specific activity will be wrongly created.

--------------------------------------------------------------------------------
Setting the target version to 4.1.6.
--------------------------------------------------------------------------------
I forgot to fix test/unit/time_entry_activity_test.rb. Reattached the patch.

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

--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------

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

  • カテゴリProject settings_43 にセット
  • 対象バージョン5.0.0_155 にセット

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

いいね!0
いいね!0