[BUGFIX] Handle missing option values in CHECKBOXGROUP and RADIOGROUP 21/48721/2
authorAndreas Häfner <andreas.haefner@tritum.de>
Thu, 16 Jun 2016 11:26:54 +0000 (13:26 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 29 Jun 2016 11:21:33 +0000 (13:21 +0200)
Options are now checked for missing values and empty values are
inserted instead.

In rebuild process RADIOGROUP and CHECKBOXGROUP for every listed option
a single RADIO/CHECKBOX element is created by its xtype-configuration.
These elements rely on a passed value attribute. To prevent errors,
triggered by missing value attributes, a check for existence of the
attribute was introduced. In case of missing value, now an empty value
is used.
This change only influences the display process of the wizard.
Generation of Form-Configuration is not changed.

Resolves: #76019
Releases: master, 7.6
Change-Id: I3f459be2bec92c9eac20fd45a7453dbe6e28f758
Reviewed-on: https://review.typo3.org/48721
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Predefined/CheckboxGroup.js
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Elements/Predefined/RadioGroup.js

index 563515f..eb7bb3d 100644 (file)
@@ -125,12 +125,16 @@ TYPO3.Form.Wizard.Elements.Predefined.CheckboxGroup = Ext.extend(TYPO3.Form.Wiza
                                        isEditable: false,
                                        cls: ''
                                });
+                               var optionValue = '';
+                               if (option.attributes && option.attributes.value) {
+                                       optionValue = option.attributes.value;
+                               }
                                var checkboxConfiguration = {
                                        label: {
                                                value: option.text
                                        },
                                        attributes: {
-                                               value: option.attributes.value
+                                               value: optionValue
                                        }
                                };
                                if (
index 2db6d5b..f93d147 100644 (file)
@@ -125,12 +125,16 @@ TYPO3.Form.Wizard.Elements.Predefined.RadioGroup = Ext.extend(TYPO3.Form.Wizard.
                                        isEditable: false,
                                        cls: ''
                                });
+                               var optionValue = '';
+                               if (option.attributes && option.attributes.value) {
+                                       optionValue = option.attributes.value;
+                               }
                                var radioConfiguration = {
                                        label: {
                                                value: option.text
                                        },
                                        attributes: {
-                                               value: option.attributes.value
+                                               value: optionValue
                                        }
                                };
                                if (