Change config UI - #8
Conversation
| foreach (self::getItilConfigFields() as $field) { | ||
| $inheritance_labels[$field] = self::getInheritedValueBadge($parentConfig->fields[$field] ?? 0); | ||
| } | ||
| foreach ([ | ||
| 'take_requester_group_ticket', | ||
| 'take_requester_group_change', | ||
| 'take_requester_group_problem', | ||
| 'take_technician_group_ticket', | ||
| 'take_technician_group_change', | ||
| 'take_technician_group_problem', | ||
| ] as $field) { | ||
| $inheritance_labels[$field] = self::getInheritedValueBadgeForActorGroup($parentConfig->fields[$field] ?? 0); |
There was a problem hiding this comment.
self::getItilConfigFields already contain
'take_requester_group_ticket',
'take_requester_group_change',
'take_requester_group_problem',
'take_technician_group_ticket',
'take_technician_group_change',
'take_technician_group_problem',
The first loop at line
185 therefore generates a Yes/No badge for them (wrong — they need group-name labels), and the second explicit loop at line 188 immediately
overwrites with the correct badge.
There was a problem hiding this comment.
The test suite doesn't cover the grandparent → parent → child chain
There was a problem hiding this comment.
Can you add a test case where the child entity fields are set to Config::CONFIG_PARENT, verify that the inherited value from the parent propagates to Controller::checkTaskRequirements, and assert both the blocked (empty mandatory fields) and unblocked (filled mandatory fields) outcomes?
| @@ -557,9 +538,6 @@ public static function updateItemActors(CommonITILObject $item): CommonITILObjec | |||
| public static function assignTechnicianFromTask(\CommonITILTask $item): void | |||
There was a problem hiding this comment.
assignTechnicianFromTask fetches config but never reads any field from it — the feature runs unconditionally for every task creation. Every other Controller method guards on a specific config flag (e.g. take_requester_group_ticket != 0); this one has no on/off toggle, which means users can't disable it from the UI.
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Checklist before requesting a review
Please delete options that are not relevant.
Description
Change to the configuration interface (switch from checkboxes to “Yes”/‘No’ options with the “Inheritance” option)
Screenshots (if appropriate):