Commit 3c5a2367 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Daniel Goerz
Browse files

[BUGFIX] Fix exclusive values in FormEngine's selectMultipleSideBySide

With splitting the FormEngine in smaller parts, a regression has been
introduced in the behavior of selectMultipleSideBySide. This select type
supports "exclusive values" which are mutually exclusively selectable.

However, due to a typo in the fetched (non-existent) data attribute, the
whole behavior was broken. This patch fixes the typo.

Resolves: #92737
Related: #87324
Releases: master, 10.4
Change-Id: Ice5de95c49d81df94ee1a8257ecab3abfe7d21d7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66361

Reviewed-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Riccardo De Contardi's avatarRiccardo De Contardi <erredeco@gmail.com>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent efae160e
......@@ -37,7 +37,7 @@ class SelectMultipleSideBySideElement extends AbstractSortableSelectItems {
const el = <HTMLSelectElement>e.currentTarget;
const fieldName = el.dataset.relatedfieldname;
if (fieldName) {
const exclusiveValues = el.dataset.exclusiveValues;
const exclusiveValues = el.dataset.exclusivevalues;
const selectedOptions = el.querySelectorAll('option:checked'); // Yep, :checked finds selected options
if (selectedOptions.length > 0) {
selectedOptions.forEach((optionElement: HTMLOptionElement): void => {
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
define(["require","exports","./AbstractSortableSelectItems","TYPO3/CMS/Core/DocumentService","TYPO3/CMS/Backend/FormEngine","./Extra/SelectBoxFilter"],(function(e,t,l,n,s,r){"use strict";class i extends l.AbstractSortableSelectItems{constructor(e,t){super(),this.selectedOptionsElement=null,this.availableOptionsElement=null,n.ready().then(l=>{this.selectedOptionsElement=l.getElementById(e),this.availableOptionsElement=l.getElementById(t),this.registerEventHandler()})}registerEventHandler(){this.registerSortableEventHandler(this.selectedOptionsElement),this.availableOptionsElement.addEventListener("click",e=>{const t=e.currentTarget,l=t.dataset.relatedfieldname;if(l){const e=t.dataset.exclusiveValues,n=t.querySelectorAll("option:checked");n.length>0&&n.forEach(t=>{s.setSelectOptionFromExternalSource(l,t.value,t.textContent,t.getAttribute("title"),e,t)})}}),new r(this.availableOptionsElement)}}return i}));
\ No newline at end of file
define(["require","exports","./AbstractSortableSelectItems","TYPO3/CMS/Core/DocumentService","TYPO3/CMS/Backend/FormEngine","./Extra/SelectBoxFilter"],(function(e,t,l,n,s,r){"use strict";class i extends l.AbstractSortableSelectItems{constructor(e,t){super(),this.selectedOptionsElement=null,this.availableOptionsElement=null,n.ready().then(l=>{this.selectedOptionsElement=l.getElementById(e),this.availableOptionsElement=l.getElementById(t),this.registerEventHandler()})}registerEventHandler(){this.registerSortableEventHandler(this.selectedOptionsElement),this.availableOptionsElement.addEventListener("click",e=>{const t=e.currentTarget,l=t.dataset.relatedfieldname;if(l){const e=t.dataset.exclusivevalues,n=t.querySelectorAll("option:checked");n.length>0&&n.forEach(t=>{s.setSelectOptionFromExternalSource(l,t.value,t.textContent,t.getAttribute("title"),e,t)})}}),new r(this.availableOptionsElement)}}return i}));
\ No newline at end of file
Supports Markdown
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