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

Exception during validation of field if getFormModel() returns null

    XMLWordPrintable

Details

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

    Description

      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

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

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

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD