Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
2.0.2
-
None
Description
Steps to reproduce
- Make sure the used test-site uses at least two locales (in our case de + en -> fallbackLocale = de) + DefaultI18nContentSupport
- Create a dialog with at least one of these:
- i18n-enabled switchableField that includes a compositeField
javascriptField (+ html file for fieldScript, can be left empty)
form:
implementationClass: info.magnolia.ui.javascript.form.FormViewWithChangeListener
$type: tabbedForm
tabs:
general:
label: 'General'
fields:
switchableField:
label: 'Switchable Field'
i18n: true
$type: switchableField
itemProvider:
$type: jcrChildNodeProvider
field:
$type: radioButtonGroupField
layout: horizontal
defaultValue: option
datasource:
$type: optionListDatasource
options:
- name: option
value: option
label: 'Option'
forms:
option:
properties:
option:
$type: compositeField
label: 'Sub Composite Field'
itemProvider:
$type: jcrChildNodeProvider
properties:
text:
label: 'Text'
$type: textField
required: true
javascriptField:
$type: javascriptField
fieldScript: /whatever-path-floats-your-boat/webresources/dialogs/components/custom-chooser.html
height: 200
parameters:
field: javascriptFieldValue
- Open the dialog with fallbackLocale (de)
- Switch Locales in bottom left dropdown menu (to en)
Expected results
Dialog should look the same as German version, just with language specific field values.
Actual results
Error gets shown in CMS + Logs reveals strack-trace with the root cause being a NullPointerException occurring in FormFieldsExtractor.
(See following file for stacktrace: stacktrace.log
)
Workaround
Error can be circumvented by explicitly adding "i18n: true" to the "Sub Composite Field".
Development notes
The error originates from "FormfieldsExtractor.getCompositeFormFields" which tries to get the appropriate representation from the subEditor.
Since i18n is not enabled for "option" (= "Sub Composite Field") it tries resolving to default-locale.
Since the representations only contain the key "en" though it resolves to null, which gets passed along to "getFormFields(...)" then "getSimpleFormFields(...)" and finally results in the attempted FormPresenter-resolution via "FormViewIntrospector.getFormPresenter(formView)" -> chained ".getBoundFields(locale)" then throws a NullPointerException.
Checklists
Attachments
Issue Links
- mentioned in
-
Page Loading...