Commit d94b1b5b authored by Andreas Fernandez's avatar Andreas Fernandez
Browse files

[BUGFIX] Handle sorting of nested IRRE containers properly

When sorting elements in an IRRE container, the sorting took
grandchildren into account as well, which broke the sorting in the
database.

With this patch, a new data attribute is added to be able to identify
direct ancestors and limit sorting to these records only.

Resolves: #92804
Releases: master, 10.4
Change-Id: I09876c3a8be45b060c133d758807e4df25fee0d2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66933

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 93ac43c7
......@@ -746,7 +746,8 @@ class InlineControlContainer {
}
const recordListContainer = <HTMLDivElement>document.getElementById(this.container.getAttribute('id') + '_records');
const records = Array.from(recordListContainer.querySelectorAll('[data-placeholder-record="0"]')).map((child: HTMLElement) => child.dataset.objectUid);
const records = Array.from(recordListContainer.querySelectorAll('[data-object-parent-group="' + this.container.dataset.objectGroup + '"][data-placeholder-record="0"]'))
.map((child: HTMLElement) => child.dataset.objectUid);
(<HTMLInputElement>formField).value = records.join(',');
(<HTMLInputElement>formField).classList.add('has-change');
......
......@@ -209,6 +209,7 @@ class InlineRecordContainer extends AbstractContainer
'data-object-uid' => $record['uid'],
'data-object-id' => $objectId,
'data-object-id-hash' => $hashedObjectId,
'data-object-parent-group' => $domObjectId . '-' . $foreignTable,
'data-field-name' => $appendFormFieldNames,
'data-topmost-parent-table' => $data['inlineTopMostParentTableName'],
'data-topmost-parent-uid' => $data['inlineTopMostParentUid'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment