Skip to content

Commit

Permalink
[BUGFIX] Fix exclusive values in FormEngine's selectMultipleSideBySide
Browse files Browse the repository at this point in the history
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/+/66362
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
andreaskienast authored and ervaude committed Oct 31, 2020
1 parent 44716b7 commit 8b93d54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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 => {
Expand Down
Expand Up @@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./AbstractSortableSelectItems","jquery","TYPO3/CMS/Backend/FormEngine","./Extra/SelectBoxFilter"],(function(e,t,l,n,r,s){"use strict";n=__importDefault(n);class i extends l.AbstractSortableSelectItems{constructor(e,t){super(),this.selectedOptionsElement=null,this.availableOptionsElement=null,n.default(()=>{this.selectedOptionsElement=document.getElementById(e),this.availableOptionsElement=document.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,s=t.querySelectorAll("option:checked");s.length>0&&s.forEach(t=>{r.setSelectOptionFromExternalSource(l,t.value,t.textContent,t.getAttribute("title"),e,n.default(t))})}}),new s(this.availableOptionsElement)}}return i}));
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./AbstractSortableSelectItems","jquery","TYPO3/CMS/Backend/FormEngine","./Extra/SelectBoxFilter"],(function(e,t,l,n,r,s){"use strict";n=__importDefault(n);class i extends l.AbstractSortableSelectItems{constructor(e,t){super(),this.selectedOptionsElement=null,this.availableOptionsElement=null,n.default(()=>{this.selectedOptionsElement=document.getElementById(e),this.availableOptionsElement=document.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,s=t.querySelectorAll("option:checked");s.length>0&&s.forEach(t=>{r.setSelectOptionFromExternalSource(l,t.value,t.textContent,t.getAttribute("title"),e,n.default(t))})}}),new s(this.availableOptionsElement)}}return i}));

0 comments on commit 8b93d54

Please sign in to comment.