fix(FOUR-32830): accept array form_data in rule expression assignees - #9008
fix(FOUR-32830): accept array form_data in rule expression assignees#9008gproly wants to merge 3 commits into
Conversation
getAssigneesFromExpression now handles array input from POST users_task_count, fixing 500 errors when REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS is enabled. https://processmaker.atlassian.net/browse/FOUR-32830
Handle array input from POST users_task_count to prevent TypeError when REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS is enabled. https://processmaker.atlassian.net/browse/FOUR-32830
|
QA server K8S was successfully deployed https://ci-fe9ffd1065.engk8s.processmaker.net |
…ay form_data Accept array form_data in getAssigneesFromExpression to prevent TypeError on users_task_count when REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS is enabled. Expand group assignees via getConsolidatedUsers, flatten manager_id, and evaluate reassignment rules using BPMN assignment type instead of getAssignmentRule(). https://processmaker.atlassian.net/browse/FOUR-32830
PR SummaryMedium Risk Overview
Feature and model tests cover user/group rule-expression filtering and array vs JSON-string Reviewed by Cursor Bugbot for commit a84c9e5. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a84c9e5. Configure here.
|
|
||
| foreach ((array) ($this->process->manager_id ?? []) as $managerId) { | ||
| if (!empty($managerId) && is_numeric($managerId)) { | ||
| $userIds[$managerId] = $managerId; |
There was a problem hiding this comment.
Group expansion drops assignable users
High Severity
getConsolidatedUsers reindexes $userIds with sequential keys via array_merge, then later keyed writes for user assignees and manager_id overwrite group members at those indexes. With REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS enabled by default, valid reassignment candidates disappear from the list.
Reviewed by Cursor Bugbot for commit a84c9e5. Configure here.
| $include_ids[] = $manager_id; | ||
| foreach ($assignments as $assignment) { | ||
| if (!in_array($assignment['assignee'], $assigneeIds, true)) { | ||
| continue; |
There was a problem hiding this comment.
Assignee match ignores rule identity
Medium Severity
The second pass treats every assignment whose assignee appears in assigneeIds as a match. User and group IDs use separate sequences, so an unmatched group rule can expand when a user rule with the same numeric ID matched, or the reverse.
Reviewed by Cursor Bugbot for commit a84c9e5. Configure here.







getAssigneesFromExpression now handles array input from POST users_task_count, fixing 500 errors when REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS is enabled.
https://processmaker.atlassian.net/browse/FOUR-32830
ci:deploy