Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8075: User (group) re-selection not possible after failed role assignment #1244

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
id: user.content.versionInfo.contentInfo.id,
name: ibexa_content_name(user)
}) %}
{% set items_map = form.users.vars.data|reduce((output, user) => output|merge({
"{{user.content.versionInfo.contentInfo.id}}": user.id
}), {}) %}
{% set items_map = form.users.vars.data|reduce((output, user) => output + {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: We have to use + to avoid numerical indexes reset caused by |merge
ref. twigphp/Twig#2741 (comment)

(user.id): user.content.versionInfo.contentInfo.mainLocationId,
}, {}) %}
{% set users_udw_title = "role_assignment.view.add.panel.users_and_groups.users.udw_title"
|trans({}, 'ibexa_role')
|desc("Select Users to assign to the Role") %}
Expand Down Expand Up @@ -66,9 +66,9 @@
id: group.content.versionInfo.contentInfo.id,
name: ibexa_content_name(group.content)
}) %}
{% set items_map = form.groups.vars.data|reduce((output, group) => output|merge({
"{{group.content.versionInfo.contentInfo.i}}": group.id
}), {}) %}
{% set items_map = form.groups.vars.data|reduce((output, group) => output + {
(group.id): group.content.versionInfo.contentInfo.mainLocationId,
}, {}) %}
{% set groups_udw_title = "role_assignment.view.add.panel.users_and_groups.groups.udw_title"
|trans({}, 'ibexa_role')
|desc("Select User Groups to assign to the Role") %}
Expand Down
Loading