Skip to content

Commit

Permalink
[BUGFIX] Use correct select element on changing owner / group
Browse files Browse the repository at this point in the history
When multiple select elements are visible, the value
of the correct element is now used when changing
the owner / group of a page in the permissions module.

This is a partial backport of #93301, only containing
the bugfix.

Resolves: #93319
Releases: 10.4
Change-Id: If136dd155d5a55acb9e711a19281a1424a75643f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67466
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
o-ba authored and bmack committed Jan 20, 2021
1 parent 602b1a0 commit e2a0439
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Expand Up @@ -104,15 +104,16 @@ class Permissions {
*/
public changeOwner($element: JQuery): void {
let page = $element.data('page');
const $container = $('#o_' + page);

(new AjaxRequest(this.ajaxUrl)).post({
action: 'change_owner',
page: page,
ownerUid: $element.data('owner'),
newOwnerUid: $('#new_page_owner').val(),
newOwnerUid: $container.find('select[name="new_page_owner"]').val(),
}).then(async (response: AjaxResponse): Promise<void> => {
// Replace content
$('#o_' + page).replaceWith(await response.resolve());
$container.replaceWith(await response.resolve());
});
}

Expand Down Expand Up @@ -171,15 +172,16 @@ class Permissions {
*/
public changeGroup($element: JQuery): void {
let page = $element.data('page');
const $container = $('#g_' + page);

(new AjaxRequest(this.ajaxUrl)).post({
action: 'change_group',
page: page,
groupUid: $element.data('groupId'),
newGroupUid: $('#new_page_group').val(),
newGroupUid: $container.find('select[name="new_page_group"]').val(),
}).then(async (response: AjaxResponse): Promise<void> => {
// Replace content
$('#g_' + page).replaceWith(await response.resolve());
$container.replaceWith(await response.resolve());
});
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e2a0439

Please sign in to comment.