Uploaded image for project: 'Magnolia Form Module'
  1. Magnolia Form Module
  2. MGNLFORM-143

Exception during validation of field if getFormModel() returns null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 1.3.3
    • validation
    • None

      The following method fails if a sub-mothod returns null!

      Class info.magnolia.module.form.paragraphs.models.FormFieldModel

          private void validate() {
              FormField field = getFormModel().getFormField(getControlName());
              valid = field == null || field.isValid();
          }
      
          private AbstractFormModel getFormModel() {
              RenderingModel model = this.parentModel;
              while (model != null) {
                  if (model instanceof AbstractFormModel)
                      return (AbstractFormModel) model;
                  model = model.getParent();
              }
              return null;
          }
      

      if method getFormModel() returns null
      the getFormModel().getFormField(getControlName()) method fails

        Acceptance criteria

              Unassigned Unassigned
              alpenmutz Umberto Camathias
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD