Commit c29f21e4 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Anja Leichsenring
Browse files

[BUGFIX] IRRE: Handle localizable records correctly

Each node in an IRRE container now has a new `data-placeholder-record`
attribute to be able to identify such node w/out accessing CSS classes
used for styling purpose.

Nodes where `data-placeholder-record` has a truthy value are localizable
and are ignored now when the sorting is changed which solves an issue
where such records would have been moved into a different language.

In the same run the localization is fixed as it was tried to iterate an
object, which doesn't work. Alternatively, the object values are fetched
and iterated now.

Resolves: #91942
Resolves: #91938
Releases: master, 10.4
Change-Id: Ic6622eb5d6950893f79d4ae9697d7eaa096d2ef9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65214

Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent a3645771
......@@ -483,7 +483,7 @@ class InlineControlContainer {
me.deleteRecord(objectIdPrefix + itemUid, true);
}
for (let item of response.compilerInput.localize) {
for (let item of Object.values(response.compilerInput.localize)) {
if (typeof item.remove !== 'undefined') {
const removableRecordContainer = InlineControlContainer.getInlineRecordContainer(objectIdPrefix + item.remove);
removableRecordContainer.parentElement.removeChild(removableRecordContainer);
......@@ -718,7 +718,7 @@ class InlineControlContainer {
}
const recordListContainer = <HTMLDivElement>document.getElementById(this.container.getAttribute('id') + '_records');
const records = Array.from(recordListContainer.children).map((child: HTMLElement) => child.dataset.objectUid);
const records = Array.from(recordListContainer.querySelectorAll('[data-placeholder-record="0"]')).map((child: HTMLElement) => child.dataset.objectUid);
(<HTMLInputElement>formField).value = records.join(',');
(<HTMLInputElement>formField).classList.add('has-change');
......
......@@ -212,6 +212,7 @@ class InlineRecordContainer extends AbstractContainer
'data-topmost-parent-table' => $data['inlineTopMostParentTableName'],
'data-topmost-parent-uid' => $data['inlineTopMostParentUid'],
'data-table-unique-original-value' => $originalUniqueValue,
'data-placeholder-record' => $data['isInlineDefaultLanguageRecordInLocalizedParentContext'] ? '1' : '0'
];
$html = '
......
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