Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-118102

Should not be possible to save a Form View containing a broken rule

    Details

      Description

      Description
      Should not be possible to save a Form View containing a broken rule.

      Steps to Reproduce SCENARIO 1

      1. Go to Global Menu > Applications > App Builder > Objects > Add a Custom Object;
      2. Add a Form View > Add some fields;
      3. Go to the Rules tab > Add a new rule using those fields > Save the Form;
      4. Reopen the Form > Remove a field from the Form Builder;
      5. Obverse that the field is not shown in the rules summary;
      6. Try to save the Form;
      7. Observe the message shown: "Error:Unable to parse expression "not(equals(getValue('Field41473544'), ))";

      Steps to Reproduce SCENARIO 2

      1. Go to Global Menu > Applications > App Builder > Objects > Add a Custom Object;
      2. Add a Form View > Add a Text field;
      3. Go to the Rules tab > Add a new rule using these fields "IF Text is not empty SHOW Text" > Save the rule > Save the Form;
      4. Reopen the Form > Remove the Text field from the Form View only;
      5. Obverse that the field is not shown in the rules summary since the rule is broken;
      6. Add a new Text field to the form body > Save the Form (it should not be possible when the scenario 1 is fixed);
      7. Reopen the Form > go to the Rules tab > observe the rule is broken (since it was pointing to the old field);
      8. Edit the rule filling it using the added Text field > Save the rule > Try to Save the Form;
      9. Observe the message shown: "status: "INTERNAL_SERVER_ERROR"
        title: "java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.spi.converter.model.SPIDDMFormRuleCondition;"";

      Expected Result

      SCENARIO 1:

      • The Form View should not be saved and the following message is displayed:
      • The message shown is should be "ERROR: There are invalid rule expressions."

      SCENARIO 2:

      • The Form View should not be saved while there is a broken rule even after adding a new field to the form view body.

      Actual Result

      SCENARIO 1:

      • The Form View is not saved and the following message is displayed:
      • "Error:Unable to parse expression "not(equals(getValue('Field41473544'), ))";

      SCENARIO 2:

      • The Form View is saved even with a broken rule, and after editing a rule to the new field the following message is displayed:
      • status: ERROR: "INTERNAL_SERVER_ERROR"
        title: "java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.spi.converter.model.SPIDDMFormRuleCondition;""; 

      Reproduced In
      master: 1686865f4fc165324741c6ad64f945df68e0e07b

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              guilherme.freire Guilherme Freire (Inactive)
              Reporter:
              guilherme.freire Guilherme Freire (Inactive)
              Participants of an Issue:
              Recent user:
              Chao Wang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 21 weeks, 5 days ago

                  Packages

                  Version Package
                  7.3.5 CE GA6
                  7.3.10 DXP GA1
                  Master