プロジェクト

全般

プロフィール

Vote #72672

未完了

Required (list-, user- or version) custom field "fixed version" with Multiple values allows nil value during status transition

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

ステータス:
Confirmed
優先度:
通常
担当者:
-
カテゴリ:
Custom fields_14
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
14
version_id:
33
issue_org_id:
12146
author_id:
38715
assigned_to_id:
1188
comments:
10
status_id:
9
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
84
ステータス-->[Confirmed]

説明

I created a custom field (type Version) called "fixed version" to be filled in at the close of a task.

Using a workshop to force a filled in field based on the situation:

|Type|Situation|Status|
|Custom Field Version with Multiple values| new| not required|
|Custom Field Version with Multiple values| closed| required|

If the task was created with a situation when the field is not required (new) and you change for a situation that the field is required (closed), the rule don´t work and allows saving without filling in the field that should be required in this situation.

Environment:
Redmine version 2.1.2.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.6
Environment production
Database adapter MySQL
Redmine plugins:
redmine_inline_attach_screenshot 0.4.2


journals

Are you testing with an _administrator_ account? If yes, take a look at #11887#note-2 (quote: "Currently, admin users inherits workflow/fields permissions for all roles. So if the field is not required for at least one role, it's not required for admins. But if you set the field required for all roles, then it will be required for admin users too.").
--------------------------------------------------------------------------------
Mischa The Evil wrote:
> Are you testing with an _administrator_ account? If yes, take a look at #11887#note-2 (quote: "Currently, admin users inherits workflow/fields permissions for all roles. So if the field is not required for at least one role, it's not required for admins. But if you set the field required for all roles, then it will be required for admin users too.").

No i am testing with a normal user account. I believe that the problem is the type of field(version).
This field is required only same profiles, maybe if This field will required for all profiles ,can be work, but i didn´t test this situation.

--------------------------------------------------------------------------------
Mateus Anacleto wrote:
> Mischa The Evil wrote:
> > ...
>
> No i am testing with a normal user account. I believe that the problem is the type of field(version).
> This field is required only same profiles, maybe if This field will required for all profiles ,can be work, but i didn´t test this situation.

I've spent some time trying to reproduce this issue's report on m.redmine.org (~2.1.0) and I've found a way to do it. I'll outline it below.

This happens _only_ with a custom field with multiple allowed values (thus of the types @list@, @user@ or @version@), required for a certain role-tracker-status combination configured via Administration -> Workflows -> Fields permissions. In this situation a @nil@ value for the custom field is accepted during status transition (to a status on which a value for the custom field is required) of an issue on a configured tracker, by a user with the configured role. The visual indication besides the custom field is displayed as if a custom field value is indeed required, but it isn't.
The result is that the status transition *is allowed* with a @nil@ value for the custom field.

Configuring the custom field with multiple allowed values via Administration -> Custom fields -> _Custom field type_ -> _Custom field_ -> _Required_ (thus required for all role-tracker-status combinations) leads to a situation where @nil@ values for custom fields actually *are not allowed*.

Remaining question would be: is this by design or not?

Please let me know if there is more info needed...
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The source of this problem is that the @validate_required_fields@ function for the @issue@ model does not check multiple custom field values in arrays.

I attached a patch based on Version version:2.2.2 that solved the problem for me.
--------------------------------------------------------------------------------
It looks like this problem is still present in the current trunk (r12230).
Is there a possibility to get this fixed in the next version?
How can I assist you in fixing this issue?
--------------------------------------------------------------------------------
If confirmed, then should be fixed with next version?
--------------------------------------------------------------------------------
Somebody just confirmed it on IRC. And it seems the patch works. The patch needs tests to ensure we don't introduce a regression later. I'll have a look at this unless somebody else wants it...
--------------------------------------------------------------------------------
Duplicated by #13891
--------------------------------------------------------------------------------

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


related_issues

relates,Needs feedback,13891,Field conditions depending on ticket status

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

  • カテゴリCustom fields_14 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

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

いいね!0
いいね!0