mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4720] FormFieldModel fix error when has no variables (#4892)
* [ADF-4720] - prevent FormFieldModel crash * [ADF-4720] - add unit test
This commit is contained in:
committed by
Eugenio Romano
parent
cae73e3c02
commit
bd24105036
@@ -400,4 +400,13 @@ describe('FormFieldModel', () => {
|
||||
|
||||
expect(field.numberOfColumns).toBe(999);
|
||||
});
|
||||
|
||||
it('should instantiate FormField when has no variable', () => {
|
||||
const form = new FormModel({});
|
||||
form.json = {
|
||||
variables: undefined
|
||||
};
|
||||
const field = new FormFieldModel(form, {});
|
||||
expect(field).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
@@ -181,7 +181,7 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
if (processVariable) {
|
||||
this.value = processVariable;
|
||||
}
|
||||
} else if (json.params.responseVariable) {
|
||||
} else if (json.params.responseVariable && form.json.variables) {
|
||||
const formVariable = this.getVariablesValue(json.params.field.name, form);
|
||||
if (formVariable) {
|
||||
this.value = formVariable;
|
||||
|
Reference in New Issue
Block a user